Beispiel #1
0
        public override void FreshProgress(float progress)
        {
            FightUI fightUI = Global.gApp.gUiMgr.GetPanelCompent <FightUI>(Wndid.FightPanel);

            if (fightUI == null)
            {
                return;
            }
            if (m_FightNpcProgress == null)
            {
                GameObject go = Global.gApp.gResMgr.InstantiateObj(Wndid.FightNpcProgress);
                go.transform.SetParent(fightUI.NpcProgress.rectTransform, false);
                m_FightNpcProgress = go.GetComponent <FightNpcProgress>();
                go.GetComponent <FollowNode>().SetFloowNode(GetTaskUINode());
            }
            m_FightNpcProgress.Received.image.fillAmount = progress;
            if (progress >= 1)
            {
                DG.Tweening.DOTweenAnimation[] dOTweenAnimations = m_FightNpcProgress.GetComponents <DG.Tweening.DOTweenAnimation>();
                foreach (DG.Tweening.DOTweenAnimation dOTweenAnimation in dOTweenAnimations)
                {
                    dOTweenAnimation.enabled = true;
                    dOTweenAnimation.DORestart();
                }
                Destroy(m_FightNpcProgress.gameObject, 3);
                m_FightNpcProgress = null;
            }
        }
Beispiel #2
0
 public override void DestroySelf()
 {
     if (m_FightNpcProgress != null)
     {
         Destroy(m_FightNpcProgress.gameObject);
         m_FightNpcProgress = null;
     }
     base.DestroySelf();
 }