Esempio n. 1
0
 void GameOver()
 {
     Catcher.ClearCatcher();
     MoleSpawner.ClearHole();
     MoleSpawner.GameStop();
     //set HighScore
 }
Esempio n. 2
0
        void GameStart()
        {
            Game1_Leveling.ResetGame(gController.mainMenu.Item4.IsSelect);
//			MoleSpawner.ClearHole ();
            MoleSpawner.GameStart();
            Catcher.CreateCatcher(snailCount);
        }
Esempio n. 3
0
 void GameReset()
 {
     GlobalPause = false;
     MoleSpawner.GameStop();
     Catcher.ClearCatcher();
     MoleSpawner.ClearHole();
 }
Esempio n. 4
0
        public static void ClearCatcher()
        {
            foreach (Catcher snail in CatcherList)
            {
                if (snail.LastestHole != null)
                {
                    MoleSpawner.ReleaseHole(snail.LastestHole);
                }

                DestroyObject(snail.gameObject);
            }
            CatcherList.Clear();
        }
Esempio n. 5
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);
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
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);
            }
        }
Esempio n. 8
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");
            }
        }
Esempio n. 9
0
 void GameUnPause()
 {
     MoleSpawner.GameStart();
     GlobalPause = false;
 }
Esempio n. 10
0
 void GamePause()
 {
     MoleSpawner.GameStop();
     GlobalPause = true;
 }