Exemplo n.º 1
0
 void Start()
 {
     ani     = transform.GetChild(0).GetComponent <Animator>();
     aniStat = AniStat.NotStarted;
     //TargetScale = GetComponent<RectTransform>().localScale;
     GetComponent <RectTransform>().localScale = new Vector3(0, 0, 0);
 }
Exemplo n.º 2
0
 ///<summary>
 ///Close this pop up window
 ///</summary>
 public void Close()
 {
     aniStat = AniStat.Closing;
     if (isInGame)
     {
         GameObject.Find("Canvas/AntiOverFlow/Finger").GetComponent <BoxCollider2D>().enabled = true;
     }
 }
Exemplo n.º 3
0
    void Ani()
    {
        switch (aniStat)
        {
        case AniStat.NotStarted:
            aniStat = AniStat.Starting;
            break;

        case AniStat.Starting:
            ani.Play("pop up");
            break;

        case AniStat.Closing:
            ani.Play("pop down");
            if (ani.gameObject.GetComponent <RectTransform>().localScale.x <= 0)
            {
                Destroy(gameObject);
            }
            break;
        }
    }