Esempio n. 1
0
        public void startHole()
        {
            MoleAnimator = GetComponent <Animator> ();
            Debug.Log("HoleStart");
            MoleAnimator.Play("HoleStart");
            //random Tag
            SnailLeveling lvl       = Game1_Leveling.GetLvling();
            float         randomTag = Random.Range(0.0f, lvl.RightMoleRate + lvl.WrongMoleRate + lvl.DangerMoleRate);

            if (randomTag < lvl.RightMoleRate)
            {
                type = MoleType.MOLE_RIGHT;
                MoleTag.SetTagIdx(type);
            }
            else if (randomTag > lvl.RightMoleRate + lvl.WrongMoleRate)
            {
                //IsDangerMole
                type = MoleType.MOLE_DANGER;
                MoleTag.SetTagIdx(type);
            }
            else
            {
                //wrong mole
                type = MoleType.MOLE_WRONG;
                MoleTag.SetTagIdx(type);
            }
            StartCoroutine("PopMole");
        }
Esempio n. 2
0
        public void setLevel()
        {
            SnailLeveling lvl = Game1_Leveling.GetLvling();

            speed    = lvl.CatcherSpeed / 100.0f;
            idleTime = lvl.CatcherIdleTime;
            shell.ChangeShell(Game1_Leveling.GetLvling().Shell);
        }
Esempio n. 3
0
        // Update is called once per frame
        void Update()
        {
            if (!IsPlay)
            {
                return;
            }
            GameState gState = GlobalGuage.GetGameState();

            if (gState == GameState.GS_PLAY)
            {
                if ((RandomHole.Count > 0) && (HoleList.Count < Game1_Leveling.GetLvling().MoleMax))
                {
                    ForceSpawn();
                }
            }
        }
Esempio n. 4
0
        IEnumerator PopMole()
        {
            MoleAnimator = GetComponent <Animator> ();
            waitTime     = Random.Range(Game1_Leveling.GetLvling().MinWaitTime, Game1_Leveling.GetLvling().MaxWaitTime);
            yield return(StartCoroutine(Wait(waitTime)));

            Debug.Log("HolePop");
            MoleAnimator.Play("HolePop");
            yield return(StartCoroutine(Wait(0.1f)));

            yield return(StartCoroutine(Wait(MoleAnimator.GetCurrentAnimatorStateInfo(0).length - 0.1f)));

            Debug.Log("HolePop : Get State Info");
            IsPop = true;
            if (type != MoleType.MOLE_RIGHT)
            {
                StartCoroutine("Countdown");
            }
        }