Пример #1
0
 //检测当前块是否结束
 private void CheckFinish()
 {
     if (isEffecting)
     {
         return;
     }
     if (!uiManager.IsTyping())
     {
         isCounting = true;
     }
 }
Пример #2
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;
     }
 }
Пример #3
0
        /// <param name="nameLabel">名字标签</param>
        /// <param name="dialogLabel">对话标签</param>
        /// <param name="avatarSprite">头像</param>
        //public TextPiece(int id, UILabel nameLabel, UILabel dialogLabel, UI2DSprite avatarSprite, string name = "", string dialog = "", string avatar ="") : base(id)
        //{
        //    setVars(name, dialog, avatar, nameLabel, dialogLabel, avatarSprite);
        //}


        /// <param name="nameLabel">名字标签</param>
        /// <param name="dialogLabel">对话标签</param>
        /// <param name="avatarSprite">头像</param>
        //public TextPiece(int id,
        //           UILabel nameLabel,
        //           UILabel dialogLabel,
        //           UI2DSprite avatarSprite,
        //           string name, string dialog, string avatar,
        //           Func<int> simpleLogic
        //        ) : base(id, simpleLogic)
        //    {
        //        setVars(name, dialog, avatar, nameLabel, dialogLabel, avatarSprite);
        //    }

        /// <param name="nameLabel">名字标签</param>
        /// <param name="dialogLabel">对话标签</param>
        /// <param name="avatarSprite">头像</param>
        //    public TextPiece(int id,
        //UILabel nameLabel,
        //UILabel dialogLabel,
        //UI2DSprite avatarSprite,
        //DataManager manager,
        //Func<DataManager, int> complexLogic,
        //string name = "", string dialog = "", string avatar = "") : base(id, complexLogic, manager)
        //    {
        //        setVars(name, dialog, avatar, nameLabel, dialogLabel, avatarSprite);

        //    }


        //public TextPiece(int id, UILabel nameLabel, UILabel dialogLabel, UI2DSprite avatarSprite, DataManager manager, Action simpleAction, string name ="", string dialog = "", string avatar = ""):
        //    base(id,simpleAction, manager)
        //{
        //    setVars(name, dialog, avatar, nameLabel, dialogLabel, avatarSprite);
        //}


        //public TextPiece(int id, UILabel nameLabel, UILabel dialogLabel, UI2DSprite avatarSprite, DataManager manager, Action<DataManager> complexAction, string name ="", string dialog = "", string avatar = ""):
        //    base(id,complexAction, manager)
        //{
        //    setVars(name, dialog, avatar, nameLabel, dialogLabel, avatarSprite);
        //}
        #endregion

        public override void Exec()
        {
            DialogBoxUIManager uiManager = diabox.GetComponent <DialogBoxUIManager>();
            SoundManager       sm        = GameObject.Find("GameManager").GetComponent <SoundManager>();

            //判断是否在打字途中点击第二下
            if (uiManager.IsTyping())
            {
                //通过UIManager执行打字结束操作
                uiManager.FinishType();
                //当前模块结束
                finish = true;
            }
            else
            {
                //通过UIManager设置文字,并开启打字机
                uiManager.SetText(this, name, dialog, voice, avatar);
                sm.SetVoice(voice);
                //模块设为未结束
                finish = false;
            }
        }