|
@@ -34,7 +34,6 @@ namespace GFGGame
|
|
|
private int _wordIndex = 0;
|
|
|
private bool _isShowLetters;
|
|
|
private bool _canClickBtnNext;
|
|
|
- private bool _waitPic;
|
|
|
private string _currentWords;
|
|
|
private string _storyStartID;
|
|
|
private string lastTextFieldType; // 上一段文本框的类型
|
|
@@ -170,6 +169,7 @@ namespace GFGGame
|
|
|
MusicManager.Instance.Play(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
|
|
|
_onCompleteStoryDialogCall = null;
|
|
|
_onCompleteStoryDialogCallParam = null;
|
|
|
+ StoryDialogDataManager.Instance.Clear();
|
|
|
}
|
|
|
|
|
|
private void OnClickBtnBack()
|
|
@@ -185,7 +185,7 @@ namespace GFGGame
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
- // StopAutoPlay();
|
|
|
+ StopAutoPlay();
|
|
|
if (_onScreenEffectComplete != null)
|
|
|
{
|
|
|
Timers.inst.Remove(OnScreenEffectComplete);
|
|
@@ -199,6 +199,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnLookBack()
|
|
|
{
|
|
|
+ StopAutoPlay();
|
|
|
if (_ui.m_btnSkip.enabled)
|
|
|
{
|
|
|
ViewManager.Show<StoryLookBackView>(_storyStartID);
|
|
@@ -269,7 +270,7 @@ namespace GFGGame
|
|
|
{
|
|
|
StoryDialogCfg storyDialogCfg = (StoryDialogCfg)_stepListToRead[0];
|
|
|
_stepListToRead.RemoveAt(0);
|
|
|
- InitStepContent(storyDialogCfg);
|
|
|
+ Timers.inst.StartCoroutine(InitStepContent(storyDialogCfg));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -324,11 +325,13 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void InitStepContent(StoryDialogCfg storyDialogCfg)
|
|
|
+ private IEnumerator InitStepContent(StoryDialogCfg storyDialogCfg)
|
|
|
{
|
|
|
- _canClickBtnNext = true;
|
|
|
- _waitPic = false;
|
|
|
+ _canClickBtnNext = false;
|
|
|
+ StoryDialogDataManager.Instance.waitPicFade = false;
|
|
|
+ HideAllDialogUI();
|
|
|
|
|
|
+ // Init resource
|
|
|
_currentStepCfg = storyDialogCfg;
|
|
|
UpdateMusic(storyDialogCfg.musicRes);
|
|
|
UpdateBg(storyDialogCfg.bgRes);
|
|
@@ -337,6 +340,18 @@ namespace GFGGame
|
|
|
PlayShake(storyDialogCfg.shakeInfoArr);
|
|
|
string content = storyDialogCfg.content;
|
|
|
content = storyDialogCfg.content.Replace("self", RoleDataManager.roleName);
|
|
|
+
|
|
|
+ bool delay = StoryDialogDataManager.Instance.waitBgChange;
|
|
|
+ while (StoryDialogDataManager.Instance.waitBgChange)
|
|
|
+ {
|
|
|
+ yield return new WaitForEndOfFrame();
|
|
|
+ }
|
|
|
+ if (delay)
|
|
|
+ {
|
|
|
+ yield return new WaitForSeconds(0.4f);
|
|
|
+ }
|
|
|
+
|
|
|
+ _canClickBtnNext = true;
|
|
|
if (content.IndexOf("//") >= 0)
|
|
|
{
|
|
|
showList(content);
|
|
@@ -352,9 +367,6 @@ namespace GFGGame
|
|
|
StopAutoPlay();
|
|
|
_ui.m_btnAutoPlay.enabled = false;
|
|
|
_wordTextField = null;
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
- _ui.m_dialogHead.target.visible = false;
|
|
|
_ui.m_list.visible = true;
|
|
|
_ui.m_list.RemoveChildrenToPool();
|
|
|
string[] list = Regex.Split(content, "//");
|
|
@@ -371,6 +383,14 @@ namespace GFGGame
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void HideAllDialogUI()
|
|
|
+ {
|
|
|
+ _ui.m_dialogText.target.visible = false;
|
|
|
+ _ui.m_dialogName.target.visible = false;
|
|
|
+ _ui.m_dialogHead.target.visible = false;
|
|
|
+ _ui.m_list.visible = false;
|
|
|
+ }
|
|
|
+
|
|
|
private void ShowDialog(StoryDialogCfg storyDialogCfg)
|
|
|
{
|
|
|
if (storyDialogCfg.showChangeName == 1 && StorageDataManager.Instance.GetStorageValue(ConstStorageId.CHANGE_NAME) == 0)
|
|
@@ -402,8 +422,6 @@ namespace GFGGame
|
|
|
if (!string.IsNullOrEmpty(headAniRes) || storyDialogCfg.suitId > 0)
|
|
|
{
|
|
|
//显示对话框半身像
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
_ui.m_dialogHead.target.visible = true;
|
|
|
_ui.m_dialogHead.m_txtName.text = roleName;
|
|
|
_ui.m_dialogHead.m_comphead.m_head.visible = false;
|
|
@@ -449,8 +467,6 @@ namespace GFGGame
|
|
|
}
|
|
|
else if (!string.IsNullOrEmpty(headRes))
|
|
|
{
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
_ui.m_dialogHead.target.visible = true;
|
|
|
_ui.m_dialogHead.m_txtName.text = roleName;
|
|
|
_ui.m_dialogHead.m_comphead.m_head.visible = true;
|
|
@@ -463,9 +479,7 @@ namespace GFGGame
|
|
|
}
|
|
|
else if (!string.IsNullOrEmpty(roleName))
|
|
|
{
|
|
|
- _ui.m_dialogText.target.visible = false;
|
|
|
_ui.m_dialogName.target.visible = true;
|
|
|
- _ui.m_dialogHead.target.visible = false;
|
|
|
_ui.m_dialogName.m_txtName.text = roleName;
|
|
|
_wordTextField = _ui.m_dialogName.m_txtContent;
|
|
|
_arrow = _ui.m_dialogName.m_iconNext;
|
|
@@ -475,18 +489,11 @@ namespace GFGGame
|
|
|
lastTextFieldType = "name";
|
|
|
_ui.m_t0.Play();
|
|
|
|
|
|
- // Wait pic's animation finished
|
|
|
- if(storyDialogCfg.picRes.Length > 0 && !storyDialogCfg.picRes.Equals("0"))
|
|
|
- {
|
|
|
- _waitPic = true;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
_ui.m_dialogText.target.visible = true;
|
|
|
- _ui.m_dialogName.target.visible = false;
|
|
|
- _ui.m_dialogHead.target.visible = false;
|
|
|
_wordTextField = _ui.m_dialogText.m_txtContent;
|
|
|
_arrow = _ui.m_dialogText.m_iconNext;
|
|
|
lastTextFieldType = "text";
|
|
@@ -567,11 +574,11 @@ namespace GFGGame
|
|
|
_wordTextField.text = "";
|
|
|
ArrayList letters = StoryUtil.GetLettersList(_currentWords);
|
|
|
|
|
|
- if (_waitPic)
|
|
|
+ if (StoryDialogDataManager.Instance.waitPicFade)
|
|
|
{
|
|
|
- _waitPic = false;
|
|
|
+ StoryDialogDataManager.Instance.waitPicFade = false;
|
|
|
_canClickBtnNext = false;
|
|
|
- yield return new WaitForSeconds(0.5f);
|
|
|
+ yield return new WaitForSeconds(0.4f);
|
|
|
_canClickBtnNext = true;
|
|
|
}
|
|
|
|