Ejemplo n.º 1
0
 // 初始化倒计时
 private void InitTimer()
 {
     if (isEffecting)
     {
         return;
     }
     // 检测当前文字是否打印结束
     if (!uiManager.IsTyping())
     {
         // 用户设置等待时间
         float waitTime = DataManager.GetInstance().configData.waitTime;
         // 等待时间存在语音情况下取大值
         maxTime    = Mathf.Max(sm.playerVoice.GetAllTime(), waitTime);
         isCounting = true;
     }
 }
Ejemplo n.º 2
0
        public void ExecAuto(Action callback)
        {
            MessageUIManager uiManager = diabox.GetComponent <MessageUIManager>();
            SoundManager     sm        = GameObject.Find("GameManager").GetComponent <SoundManager>();

            //判断是否在打字途中点击第二下
            if (uiManager.IsTyping())
            {
                //通过UIManager执行打字结束操作
                uiManager.FinishType();
                //当前模块结束
                finish = true;
            }
            else
            {
                HistoryManager hm = GameObject.Find("GameManager").GetComponent <HistoryManager>();
                hm.AddToTable(new BacklogText(name, dialog, voice, avatar));
                hm.SetCurrentText(name, dialog);

                if (l2dmouth == -1)
                {
                    sm.SetVoice(voice);
                }
                else
                {
                    // liv2d口型部分
                    ImageManager im = GameObject.Find("GameManager").GetComponent <ImageManager>();
                    sm.SetVoiceWithLive2d(voice, im.GetLive2dObject(0));
                }
                //通过UIManager设置文字,并开启打字机
                Debug.Log(operate);
                switch (operate)
                {
                case OperateMode.Line:
                    uiManager.ClearText();
                    uiManager.SetText(this, dialog, name, avatar);
                    //未结束等待打字机
                    finish = false;
                    break;

                case OperateMode.PageLine:
                    uiManager.HideNextIcon();
                    uiManager.AddText(this, dialog);
                    //未结束等待打字机
                    finish = false;
                    break;

                case OperateMode.LineFeed:
                    uiManager.LineFeed();
                    finish = true;
                    callback();
                    break;

                case OperateMode.ClearPage:
                    uiManager.ClearText();
                    // 已经执行完毕
                    finish = true;
                    callback();
                    break;
                }
            }
        }