|
@@ -14,6 +14,7 @@ namespace GFGGame
|
|
|
private UI_StoryDialogUI _ui;
|
|
|
private UI_CompArrow _arrow;
|
|
|
private GameObject _sceneObject;
|
|
|
+ private GameObject _animObject;
|
|
|
private EffectUI _effectUI1;
|
|
|
private DressUpObjUI _dressUpObjUI;
|
|
|
private GTextField _wordTextField;
|
|
@@ -51,6 +52,12 @@ namespace GFGGame
|
|
|
_sceneObject = null;
|
|
|
}
|
|
|
|
|
|
+ if(_animObject != null)
|
|
|
+ {
|
|
|
+ PrefabManager.Instance.Restore(_animObject);
|
|
|
+ _animObject = null;
|
|
|
+ }
|
|
|
+
|
|
|
_dressUpObjUI?.Dispose();
|
|
|
_dressUpObjUI = null;
|
|
|
|
|
@@ -98,9 +105,11 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
+
|
|
|
if (_sceneObject == null)
|
|
|
{
|
|
|
_sceneObject = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetPrefabPath("SceneStoryDialog"));
|
|
|
+
|
|
|
}
|
|
|
if (_dressUpObjUI == null)
|
|
|
{
|
|
@@ -165,11 +174,20 @@ namespace GFGGame
|
|
|
Timers.inst.Remove(ShowNextWords);
|
|
|
ScreenBlackController.Instance.HideBlack();
|
|
|
StopAutoPlay();
|
|
|
+ VoiceManager.Instance.StopVoice();
|
|
|
+
|
|
|
if (_sceneObject != null)
|
|
|
{
|
|
|
PrefabManager.Instance.Restore(_sceneObject);
|
|
|
_sceneObject = null;
|
|
|
}
|
|
|
+
|
|
|
+ if (_animObject != null)
|
|
|
+ {
|
|
|
+ PrefabManager.Instance.Restore(_animObject);
|
|
|
+ _animObject = null;
|
|
|
+ }
|
|
|
+
|
|
|
_dressUpObjUI.dressUpObj.TakeOffAll();
|
|
|
MusicManager.Instance.PlayCroutine(ResPathUtil.GetMusicPath(ConstMusicName.DEFAULT));
|
|
|
_onCompleteStoryDialogCall = null;
|
|
@@ -309,6 +327,7 @@ namespace GFGGame
|
|
|
{
|
|
|
delay = _currentStepCfg.blankScreenDur;
|
|
|
UpdatePic("0");
|
|
|
+ UpdateAnim("0");
|
|
|
}
|
|
|
}
|
|
|
if (delay > 0)
|
|
@@ -349,6 +368,7 @@ namespace GFGGame
|
|
|
UpdateMusic(storyDialogCfg.musicRes);
|
|
|
UpdateBg(storyDialogCfg.bgRes);
|
|
|
UpdatePic(storyDialogCfg.picRes);
|
|
|
+ UpdateAnim(storyDialogCfg.aniRes);
|
|
|
UpdateRoleObj(storyDialogCfg.name);
|
|
|
PlayEffect(storyDialogCfg.effectInfoArr);
|
|
|
PlayShake(storyDialogCfg.shakeInfoArr);
|
|
@@ -441,17 +461,11 @@ namespace GFGGame
|
|
|
|
|
|
VoiceManager.Instance.StopVoice();
|
|
|
// 如果配置了语音,读取语音
|
|
|
- VoiceManager.Instance.LoadRes(ResPathUtil.GetCardSoundPath("test", "wav"));
|
|
|
+ VoiceManager.Instance.LoadRes(ResPathUtil.GetVoicePath(storyDialogCfg.voiceRes));
|
|
|
_wordList = Regex.Split(words, "&&");
|
|
|
|
|
|
- if (effectInfo.Length > 0)
|
|
|
- {
|
|
|
- // 等待CG播放完毕直接进入下一段
|
|
|
- Timers.inst.StartCoroutine(WaitCGAnimFinish(effectInfo[0], int.Parse(effectInfo[1])));
|
|
|
- }
|
|
|
-
|
|
|
// 有对话
|
|
|
- if (_wordList.Length > 0)
|
|
|
+ if (_wordList.Length > 0 && !_wordList[0].Equals(""))
|
|
|
{
|
|
|
if (roleName == "self")
|
|
|
{
|
|
@@ -582,6 +596,20 @@ namespace GFGGame
|
|
|
|
|
|
ShowNextDialog();
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OnStepComplete();
|
|
|
+ //if (effectInfo.Length > 0)
|
|
|
+ //{
|
|
|
+ // // 等待CG播放完毕直接进入下一段
|
|
|
+ // Timers.inst.StartCoroutine(WaitCGAnimFinish(effectInfo[0], int.Parse(effectInfo[1])));
|
|
|
+ //}
|
|
|
+ //// 播放效果等
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // OnStepComplete();
|
|
|
+ //}
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -701,6 +729,23 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void UpdateAnim(string value)
|
|
|
+ {
|
|
|
+ if (value.Length > 0 && !IsTeaParty)
|
|
|
+ {
|
|
|
+ if (value == "0")
|
|
|
+ {
|
|
|
+ SceneController.ControlBgVisible(_sceneObject, true);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SceneController.ControlBgVisible(_sceneObject, false);
|
|
|
+
|
|
|
+ }
|
|
|
+ SceneController.UpdateDialogAnim(value, ref _animObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void UpdateRoleObj(string value)
|
|
|
{
|
|
|
if (IsTeaParty)
|
|
@@ -828,7 +873,7 @@ namespace GFGGame
|
|
|
|
|
|
private IEnumerator WaitCGAnimFinish(string resName, int times = 1)
|
|
|
{
|
|
|
- GameObject cg = PrefabManager.Instance.InstantiateSync(ResPathUtil.GetStoryDialogCGPath(resName));
|
|
|
+ GameObject cg = PrefabManager.Instance.InstantiateSync("test");
|
|
|
Animator animator = cg.GetComponentInChildren<Animator>();
|
|
|
AnimatorStateInfo info = animator.GetCurrentAnimatorStateInfo(0);
|
|
|
|