Example #1
0
 public override void Bounce()
 {
     if (returnedState == null)
     {
         returnedState = new PlayerBounceState();
         StateSwap();
     }
 }
Example #2
0
 private void Awake()
 {
     rigidbody = GetComponent <Rigidbody>();
     rigidbody.freezeRotation = true;
     rigidbody.useGravity     = false;
     score        = mainCamera.GetComponent <Gui> ().score_count;
     idleState    = new PlayerIdleState(this);
     walkState    = new PlayerWalkState(this);
     bounceState  = new PlayerBounceState(this);
     sneakState   = new PlayerSneakState(this);
     hookState    = new PlayerHookState(this);
     targetState  = new PlayerTargetState(this);
     distToGround = GetComponent <Collider> ().bounds.extents.y;
 }