修复部分问题
1. 章节解锁问题 2. 部分文字显示错误 3. 部分图层排序错误
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
@@ -6,6 +7,7 @@ using AibisDream.Utility;
|
||||
using DG.Tweening;
|
||||
using Febucci.UI;
|
||||
using Febucci.UI.Core;
|
||||
using Newtonsoft.Json;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -21,6 +23,7 @@ namespace AibisDream.FixSystem
|
||||
[SerializeField] private TMP_Text textForEstimation;
|
||||
[SerializeField] private int maxLineNum = 10;
|
||||
|
||||
private ScreenData _screenData;
|
||||
private GameObject _textItemPrefab;
|
||||
private Queue<TypewriterByCharacter> _lineQueue;
|
||||
|
||||
@@ -46,6 +49,8 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void Register()
|
||||
{
|
||||
_screenData = new ScreenData { screenSystem = this };
|
||||
StorageSystem.Instance.RegisterData(_screenData);
|
||||
FixSystemCenter.SystemDic.Register(this);
|
||||
DialogUIManager.Instance.RegisterScreenView(DialogViewType.Screen, this);
|
||||
DialogUIManager.Instance.RegisterScreenView(DialogViewType.Task, TaskScreen);
|
||||
@@ -53,6 +58,7 @@ namespace AibisDream.FixSystem
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
StorageSystem.Instance.UnregisterData<ScreenData>();
|
||||
FixSystemCenter.SystemDic.Unregister<ScreenSystem>();
|
||||
DialogUIManager.Instance.UnRegisterScreenView(DialogViewType.Screen);
|
||||
DialogUIManager.Instance.UnRegisterScreenView(DialogViewType.Task);
|
||||
@@ -76,9 +82,10 @@ namespace AibisDream.FixSystem
|
||||
ShowTitle(string.Empty);
|
||||
}
|
||||
|
||||
public void ShowTaskPanel()
|
||||
public void ShowTaskPanel(float duration = 1f)
|
||||
{
|
||||
TaskScreen.transform.DOLocalMoveX(-7.12f, 1f);
|
||||
TaskScreen.transform.DOLocalMoveX(-7.12f, duration);
|
||||
_screenData.isTaskPanelShown = true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -95,7 +102,7 @@ namespace AibisDream.FixSystem
|
||||
ShowTitle(token.lineInfo.character.GetActorName());
|
||||
// 显示文本
|
||||
TypewriterCore textItemTypewriter = AddText(token);
|
||||
|
||||
|
||||
token.TextStart();
|
||||
|
||||
// 强制更新布局
|
||||
@@ -128,7 +135,7 @@ namespace AibisDream.FixSystem
|
||||
}
|
||||
_lineQueue.Enqueue(textItemTypewriter);
|
||||
|
||||
|
||||
|
||||
textItemTypewriter.SetTypewriterSpeed(GetTextSpeedValue());
|
||||
textItemTypewriter.onTextShowed.AddListener(() => OnTextShown(token, textItemTypewriter));
|
||||
textItemTypewriter.ShowText(token.lineInfo.lineText);
|
||||
@@ -148,4 +155,20 @@ namespace AibisDream.FixSystem
|
||||
return _lineQueue.Select(x => x.GetComponent<TMP_Text>().textInfo.lineCount).Sum();
|
||||
}
|
||||
}
|
||||
|
||||
public class ScreenData : IData
|
||||
{
|
||||
[JsonIgnore]
|
||||
public ScreenSystem screenSystem;
|
||||
public bool isTaskPanelShown = false;
|
||||
|
||||
public IEnumerator Load()
|
||||
{
|
||||
if (isTaskPanelShown)
|
||||
{
|
||||
screenSystem.ShowTaskPanel(0);
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user