示例#1
0
        IEnumerator DestroyCatchHole()
        {
            //calculate score here
            LockOn.SetActive(false);
            IsPop        = false;
            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);
        }
示例#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);
            }
        }
示例#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);
            }
        }