|
@@ -33,8 +33,11 @@ namespace GFGGame
|
|
|
private string[] _wordList;
|
|
|
private int _wordIndex = 0;
|
|
|
private bool _isShowLetters;
|
|
|
+ private bool _canClickBtnNext;
|
|
|
+ private bool _waitPic;
|
|
|
private string _currentWords;
|
|
|
private string _storyStartID;
|
|
|
+ private string lastTextFieldType; // 上一段文本框的类型
|
|
|
|
|
|
//屏幕效果中
|
|
|
private Action<object> _onScreenEffectComplete;
|
|
@@ -111,6 +114,7 @@ namespace GFGGame
|
|
|
}
|
|
|
_speedAutoPlay = FightDataManager.Instance.dialogSpeed;
|
|
|
_autoPlay = false;
|
|
|
+ lastTextFieldType = "";
|
|
|
UpdateSpeedUpBtn();
|
|
|
_dialogListLookBack = new List<string>();
|
|
|
object[] datas = viewData as object[];
|
|
@@ -146,6 +150,7 @@ namespace GFGGame
|
|
|
FightDataManager.Instance.dialogSpeed = _speedAutoPlay;
|
|
|
}
|
|
|
_ui.m_btnBack.visible = InstanceZonesDataManager.CheckLevelPass(100001001);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
@@ -176,6 +181,10 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnNext()
|
|
|
{
|
|
|
+ if (!_canClickBtnNext)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
// StopAutoPlay();
|
|
|
if (_onScreenEffectComplete != null)
|
|
|
{
|
|
@@ -317,6 +326,9 @@ namespace GFGGame
|
|
|
|
|
|
private void InitStepContent(StoryDialogCfg storyDialogCfg)
|
|
|
{
|
|
|
+ _canClickBtnNext = true;
|
|
|
+ _waitPic = false;
|
|
|
+
|
|
|
_currentStepCfg = storyDialogCfg;
|
|
|
UpdateMusic(storyDialogCfg.musicRes);
|
|
|
UpdateBg(storyDialogCfg.bgRes);
|
|
@@ -433,6 +445,7 @@ namespace GFGGame
|
|
|
}
|
|
|
_wordTextField = _ui.m_dialogHead.m_txtContent;
|
|
|
_arrow = _ui.m_dialogHead.m_iconNext;
|
|
|
+ lastTextFieldType = "head";
|
|
|
}
|
|
|
else if (!string.IsNullOrEmpty(headRes))
|
|
|
{
|
|
@@ -446,6 +459,7 @@ namespace GFGGame
|
|
|
_ui.m_dialogHead.m_comphead.m_head.url = ResPathUtil.GetNpcHeadPath(headRes);
|
|
|
_wordTextField = _ui.m_dialogHead.m_txtContent;
|
|
|
_arrow = _ui.m_dialogHead.m_iconNext;
|
|
|
+ lastTextFieldType = "head";
|
|
|
}
|
|
|
else if (!string.IsNullOrEmpty(roleName))
|
|
|
{
|
|
@@ -455,6 +469,18 @@ namespace GFGGame
|
|
|
_ui.m_dialogName.m_txtName.text = roleName;
|
|
|
_wordTextField = _ui.m_dialogName.m_txtContent;
|
|
|
_arrow = _ui.m_dialogName.m_iconNext;
|
|
|
+
|
|
|
+ if (!lastTextFieldType.Equals("name"))
|
|
|
+ {
|
|
|
+ lastTextFieldType = "name";
|
|
|
+ _ui.m_t0.Play();
|
|
|
+
|
|
|
+ // Wait pic's animation finished
|
|
|
+ if(storyDialogCfg.picRes.Length > 0 && !storyDialogCfg.picRes.Equals("0"))
|
|
|
+ {
|
|
|
+ _waitPic = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -463,9 +489,11 @@ namespace GFGGame
|
|
|
_ui.m_dialogHead.target.visible = false;
|
|
|
_wordTextField = _ui.m_dialogText.m_txtContent;
|
|
|
_arrow = _ui.m_dialogText.m_iconNext;
|
|
|
+ lastTextFieldType = "text";
|
|
|
}
|
|
|
_wordList = Regex.Split(words, "&&");
|
|
|
_wordIndex = 0;
|
|
|
+
|
|
|
ShowNextDialog();
|
|
|
}
|
|
|
|
|
@@ -485,7 +513,8 @@ namespace GFGGame
|
|
|
{
|
|
|
_wordTextField.data = null;
|
|
|
}
|
|
|
- StartShowLetters();
|
|
|
+
|
|
|
+ Timers.inst.StartCoroutine(StartShowLetters());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -530,13 +559,22 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void StartShowLetters()
|
|
|
+ private IEnumerator StartShowLetters()
|
|
|
{
|
|
|
_isShowLetters = true;
|
|
|
_arrow.target.visible = false;
|
|
|
_wordTextField.verticalAlign = VertAlignType.Top;
|
|
|
_wordTextField.text = "";
|
|
|
ArrayList letters = StoryUtil.GetLettersList(_currentWords);
|
|
|
+
|
|
|
+ if (_waitPic)
|
|
|
+ {
|
|
|
+ _waitPic = false;
|
|
|
+ _canClickBtnNext = false;
|
|
|
+ yield return new WaitForSeconds(0.5f);
|
|
|
+ _canClickBtnNext = true;
|
|
|
+ }
|
|
|
+
|
|
|
Timers.inst.Add(GameConst.LETTERS_INTERVAL_MAX / _speedAutoPlay, 0, UpdateLetters, letters);
|
|
|
}
|
|
|
|