示例#1
0
        void Play(FlyWordData data)
        {
            int?id = GameEntry.UI.OpenUIForm(UIFormId.FlyWordForm, data);

            if (!id.HasValue)
            {
                Log.Error("Play flyWord fail.");
                return;
            }

            m_RecycleQueue.Enqueue(id.Value);
        }
示例#2
0
        protected override void OnOpen(object userData)
        {
            base.OnOpen(userData);

            m_Data = userData as FlyWordData;
            if (m_Data == null)
            {
                Log.Error("userData is invlid.");
                return;
            }

            switch (m_Data.Type)
            {
            case FlyWordType.NormalHurt:
                m_Ctrl.selectedIndex = 0;
                m_Normal.text        = GlobalTools.Format("-{0}", m_Data.Value);
                m_Normal.color       = Color.red;
                break;

            case FlyWordType.CritHurt:
                m_Ctrl.selectedIndex = 3;
                m_Crit.text          = GlobalTools.Format("-{0}", m_Data.Value);
                m_Crit.color         = Color.yellow;
                break;

            case FlyWordType.HpHeal:
                m_Ctrl.selectedIndex = 0;
                m_Normal.text        = GlobalTools.Format("+{0}", m_Data.Value);
                m_Normal.color       = Color.green;
                break;

            case FlyWordType.MpHeal:
                m_Ctrl.selectedIndex = 0;
                m_Normal.text        = GlobalTools.Format("+{0}", m_Data.Value);
                m_Normal.color       = Color.blue;
                break;

            case FlyWordType.Miss:
                m_Ctrl.selectedIndex = 1;
                break;

            case FlyWordType.Parry:
                m_Ctrl.selectedIndex = 2;
                break;
            }

            m_Transition.Stop();

            if (UI != null && UI.visible)
            {
                m_Transition.Play();
            }
        }
示例#3
0
        protected void ShowFlyword(FlyWordType type, int value)
        {
            if (IsDead)
            {
                return;
            }

            FlyWordData data = new FlyWordData
            {
                Type   = type,
                Value  = value,
                Target = CachedTransform,
                Height = Height
            };

            FlyWordManager.Instance.Show(data);
        }
示例#4
0
        public void Step()
        {
            if (m_Queue.Count == 0)
            {
                return;
            }

            if (m_Timer > m_ShowInterval && m_Queue.Count > 0)
            {
                FlyWordData item = m_Queue.Dequeue();
                Play(item);
                if (m_RecycleQueue.Count > m_MinCount)
                {
                    GameEntry.UI.CloseUIForm(m_RecycleQueue.Dequeue());
                }

                m_Timer = 0;
            }
            else
            {
                m_Timer++;
            }
        }
示例#5
0
 public void Show(FlyWordData data)
 {
     m_Queue.Enqueue(data);
 }