Exemple #1
0
    public void DoShowUI(ShowHideDirection dir)
    {
        if (mShow)
        {
            return;
        }
        mShow = true;

        _DoShowUI(dir);

        _OnShow();

        if (onShow != null)
        {
            onShow();
        }
    }
Exemple #2
0
    public void DoHideUI(ShowHideDirection dir)
    {
        if (!mShow)
        {
            return;
        }
        mShow = false;

        if (GetComponent <Animation>() && GetComponent <Animation>().enabled&& dir != ShowHideDirection.none)
        {
            StartCoroutine("crRollOutAndHide", dir);
        }
        else
        {
            gameObject.SetActive(false);
        }

        _OnHide();
    }
Exemple #3
0
 protected void _DoShowUI(ShowHideDirection dir)
 {
     StopAllCoroutines();
     NGUITools.SetActive(gameObject, true);
     gameObject.AddMissingComponent <UIManagedPanel>();
     NGUITools.BringForward(gameObject);
     if (GetComponent <Animation>() && GetComponent <Animation>().enabled)
     {
         GetComponent <Animation>().Rewind();
         if (dir == ShowHideDirection.left)
         {
             GetComponent <Animation>().Play("UIRollInL");
         }
         else if (dir == ShowHideDirection.right)
         {
             GetComponent <Animation>().Play("UIRollInR");
         }
     }
 }
Exemple #4
0
    IEnumerator crRollOutAndHide(ShowHideDirection dir)
    {
        if (GetComponent <Animation>() && GetComponent <Animation>().enabled)
        {
            GetComponent <Animation>().Rewind();
            if (dir == ShowHideDirection.left)
            {
                GetComponent <Animation>().Play("UIRollOutL");
            }
            else if (dir == ShowHideDirection.right)
            {
                GetComponent <Animation>().Play("UIRollOutR");
            }


            yield return(new WaitForSeconds(1));

            gameObject.SetActive(false);
        }
    }