protected override void OnEnd(AbstractPanel panelBefore, AbstractPanel newPanel)
 {
     newPanel.m_TransFrom.position = GlobalVar.GCanvasObj.transform.position;
     if (panelBefore != null && panelBefore.IsVisable())
     {
         panelBefore.Disable();
     }
 }
Exemplo n.º 2
0
        private void PanelFadeOut(AbstractPanel panelBefore, float time, Action endCall)
        {
            CanvasGroup cg;

            if (panelBefore != null)
            {
                cg = panelBefore.m_TransFrom.GetComponent <CanvasGroup>();
                if (cg == null)
                {
                    cg = panelBefore.m_TransFrom.gameObject.AddComponent <CanvasGroup>();
                }
                MainLoop.Instance.UpdateForSeconds(() => { cg.alpha -= Time.deltaTime / time; }, time,
                                                   () =>
                {
                    cg.alpha = 1;
                    if (panelBefore.IsVisable())
                    {
                        panelBefore.Disable();
                    }
                    endCall();
                });
            }
        }