Ejemplo n.º 1
0
        public static void ClearCatcher()
        {
            foreach (Catcher snail in CatcherList)
            {
                if (snail.LastestHole != null)
                {
                    MoleSpawner.ReleaseHole(snail.LastestHole);
                }

                DestroyObject(snail.gameObject);
            }
            CatcherList.Clear();
        }
Ejemplo n.º 2
0
        IEnumerator DestroyHole()
        {
            IsPop = false;
            LockOn.SetActive(false);
            MoleAnimator = GetComponent <Animator> ();
            GetComponent <AudioSource>().PlayOneShot(hitSound[Random.Range(0, 2)]);
            MoleAnimator.Play("HoleTouch");
            if (type == MoleType.MOLE_RIGHT)
            {
                Catcher.BoringCatcher();
                //catcher make bored face here
                GameObject hpObj = GameObject.Instantiate(HPNortify) as GameObject;
                hpObj.SetActive(true);
                hpObj.transform.position = this.transform.position;
                hpObj.GetComponent <HPNotification>().DecreaseLife(1);
                GlobalGuage.DecreaseLife();
                GlobalGuage.BrokeCombo();
            }
            else
            {
                GlobalGuage.AddScore(Game1_Leveling.GetTouchMoleScore());
                GlobalGuage.AddCombo();
            }
            while ((MoleAnimator != null) && MoleAnimator.GetCurrentAnimatorStateInfo(0).IsName("HolePop"))
            {
                yield return(null);
            }
            if (MoleAnimator == null)
            {
                yield break;
            }
            yield return(StartCoroutine(Wait(MoleAnimator.GetCurrentAnimatorStateInfo(0).length)));

            MoleSpawner.DestroyHole(this);
            if (!IsLock)
            {
                MoleSpawner.ReleaseHole(this);
            }
        }
Ejemplo n.º 3
0
        IEnumerator DestroyCountHole()
        {
            //calculate score here
            IsPop = false;
            GlobalGuage.BrokeCombo();
            MoleAnimator = GetComponent <Animator> ();
            MoleAnimator.Play("HoleDepop");
            while ((MoleAnimator != null) && MoleAnimator.GetCurrentAnimatorStateInfo(0).IsName("HolePop"))
            {
                yield return(null);
            }
            if (MoleAnimator == null)
            {
                yield break;
            }
            yield return(StartCoroutine(Wait(MoleAnimator.GetCurrentAnimatorStateInfo(0).length)));

            MoleSpawner.DestroyHole(this);
            if (!IsLock)
            {
                MoleSpawner.ReleaseHole(this);
            }
        }
Ejemplo n.º 4
0
        IEnumerator Idle()
        {
            idle = true;
            Animator anim = GetComponent <Animator> ();

            anim.Play("SnailIdle");
            yield return(StartCoroutine(Wait(idleTime)));

            if (targetHole.IsPop)
            {
                idle = false;
                if (LastestHole != null)
                {
                    MoleSpawner.ReleaseHole(LastestHole);
                }
                LastestHole = targetHole;
                StartCoroutine("Moveto", targetHole);
            }
            else
            {
                targetHole = null;
                StartCoroutine("FindHole");
            }
        }