Exemple #1
0
 public override void EndJumpEvent()
 {
     if (RunGameManager.InGuide())
     {
         RunGameManager.GetGuideMgr().EndJump();
     }
 }
Exemple #2
0
 public override void Jump()
 {
     if (RunGameManager.InGuide())
     {
         if (RunGameManager.GetGuideMgr().CanJump())
         {
             base.Jump();
         }
     }
     else
     {
         base.Jump();
     }
 }
Exemple #3
0
 void Throw()
 {
     if (RunGameManager.InGuide())
     {
         if (RunGameManager.GetGuideMgr().CanThrow())
         {
             RunGameManager.Instance.Throw();
         }
     }
     else
     {
         RunGameManager.Instance.Throw();
     }
 }
Exemple #4
0
        protected override void Update()
        {
            base.Update();

            if (Input.GetMouseButtonDown(0))
            {
                switch (RunGameManager.GetGameState())
                {
                case GameState.RunningOnNormal:
                    Jump();
                    break;

                case GameState.RunningOnLoop:
                    Jump();
                    break;

                case GameState.WaitForThrow:
                    Throw();
                    break;

                case GameState.AfterThrow:
                    Jump();
                    break;
                }
            }
            time += Time.deltaTime;
            if (RunGameManager.InGuide() && time > 0.1f)
            {
                time = 0;
                RaycastHit hit;
                if (Physics.Raycast(transform.position + Vector3.up * 0.2f, transform.forward, out hit, 2))
                {
                    if (hit.transform.GetComponent <Obstacle>() != null)
                    {
                        RunGameManager.GetGuideMgr().GuideToJump();
                    }
                }
            }


            if (isBlinking)
            {
                blinkLastTime += Time.deltaTime;
                if (blinkLastTime > blinkDuration)
                {
                    blinkLastTime = 0;
                    blinkCount++;
                    foreach (var r in renderers)
                    {
                        r.enabled = !r.enabled;
                    }
                }

                if (blinkCount > blinkMaxCount)
                {
                    isBlinking = false;
                    foreach (var r in renderers)
                    {
                        r.enabled = true;
                    }
                }
            }
        }