コード例 #1
0
        public void Enter(PlayerController p)
        {
            p.SetPhysicsProfile(p.PhysJumpGetup);
            p.Jump(p.Surface.SurfaceNormal, p.JumpForce);

            p.SpriteManager.SetAnimation("Jump");
        }
コード例 #2
0
        public void Enter(PlayerController p)
        {
            startTime = Time.time;
            p.SpriteManager.SetAnimation(Animation);
            duration = p.SpriteManager.GetAnimationLength(Animation);

            p.SetPhysicsProfile(p.PhysGrounded);
        }
コード例 #3
0
        public void Enter(PlayerController p)
        {
            p.SpriteManager.SetAnimation(wallJump ? WallJumpAnim : JumpAnim);

            startTime = Time.time;
            p.SetPhysicsProfile(p.PhysJumpStandard);

            // Jump, using passed values if extant.
            var d = direction ?? p.Surface.SurfaceNormal;
            var f = force ?? p.JumpForce;

            p.Jump(d, f);
        }
コード例 #4
0
        public IState Execute(PlayerController p)
        {
            p.Move();
            p.ApplyGravity();

            if (p.Falling)
            {
                p.SetPhysicsProfile(p.PhysJumpGetup);
                return(new FallState());
            }

            // Only re-slide if moving down, otherwise we
            // risk regrounding immediately after jumping.
            if (p.Surface.Unstable && p.Velocity.y < 0)
            {
                return(new FallSlideState());
            }

            return(null);
        }
コード例 #5
0
 public void Enter(PlayerController p)
 {
     p.SetPhysicsProfile(p.PhysGrounded);
 }