Esempio n. 1
0
    private void Awake()
    {
        inputCon     = transform.Find("Input_Container").gameObject;
        confirmCon   = transform.Find("Confirm_Container").gameObject;
        xingLabel    = inputCon.transform.Find("X_Label").GetComponent <UILabel>();
        mingLabel    = inputCon.transform.Find("M_Label").GetComponent <UILabel>();
        nameSetLabel = confirmCon.transform.Find("Name_Label").GetComponent <UILabel>();

        duiManager = transform.parent.Find("DialogBox_Panel").GetComponent <DialogBoxUIManager>();
        clickCon   = transform.parent.Find("DialogBox_Panel/Click_Container").gameObject;
    }
Esempio n. 2
0
        public void ExecAuto(Action callback)
        {
            DialogBoxUIManager uiManger = diabox.GetComponent <DialogBoxUIManager>();

            if (isopen)
            {
                uiManger.Open(time, callback);
            }
            else
            {
                uiManger.Close(time, callback);
            }
        }
Esempio n. 3
0
        public override void Exec()
        {
            DialogBoxUIManager uiManger = diabox.GetComponent <DialogBoxUIManager>();

            if (isopen)
            {
                uiManger.Open(time, new Action(() => { }));
            }
            else
            {
                uiManger.Close(time, new Action(() => { }));
            }
        }
Esempio n. 4
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;
            }
        }
Esempio n. 5
0
        public void Clear()
        {
            DialogBoxUIManager uiManager = diabox.GetComponent <DialogBoxUIManager>();

            uiManager.ClearText();
        }
Esempio n. 6
0
        public void HideIcon()
        {
            DialogBoxUIManager uiManager = diabox.GetComponent <DialogBoxUIManager>();

            uiManager.HideNextIcon();
        }