Exemplo n.º 1
0
 void GameOver()
 {
     Catcher.ClearCatcher();
     MoleSpawner.ClearHole();
     MoleSpawner.GameStop();
     //set HighScore
 }
Exemplo n.º 2
0
        void GameStart()
        {
            Game1_Leveling.ResetGame(gController.mainMenu.Item4.IsSelect);
//			MoleSpawner.ClearHole ();
            MoleSpawner.GameStart();
            Catcher.CreateCatcher(snailCount);
        }
Exemplo n.º 3
0
 void GameReset()
 {
     GlobalPause = false;
     MoleSpawner.GameStop();
     Catcher.ClearCatcher();
     MoleSpawner.ClearHole();
 }
Exemplo 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();
        }
Exemplo 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);
        }
Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo 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");
            }
        }
Exemplo n.º 9
0
 void GameUnPause()
 {
     MoleSpawner.GameStart();
     GlobalPause = false;
 }
Exemplo n.º 10
0
 void GamePause()
 {
     MoleSpawner.GameStop();
     GlobalPause = true;
 }