예제 #1
0
    public override void OnStart()
    {
        /* Input Setup. */
        inputFilter = new List <PInput>()
        {
            PInput.Vertical, PInput.Horizontal, PInput.Up, PInput.Down, PInput.Left, PInput.Right, PInput.Sprint, PInput.Dash
        };
        base.OnStart(); // Creates Input Manager.

        /* Calc Movement Variables. */
        gravity         = -(2 * PStats.jumpHeightMax) / Mathf.Pow(PStats.timeToJumpApex, 2);
        jumpVelocityMax = Mathf.Abs(gravity * PStats.timeToJumpApex);
        jumpVelocityMin = Mathf.Sqrt(2 * Mathf.Abs(gravity) * PStats.jumpHeightMin);
        activeSpeed     = moveSpeed;

        wallHitSpeed.x = activeSpeed;
        //wallFrictionDown = 1;

        /* Create States. */
        SAirborne      = new PScytheMovement_Airborne(this); // Overridden Airborne type.
        SIdle          = new PBaseMovement_Idle(this);
        SRunning       = new PBaseMovement_Running(this);
        SOnWall        = new PBaseMovement_OnWall(this);
        SClimbingSlope = new PBaseMovement_ClimbingSlope(this);
        STopSlope      = new PBaseMovement_TopSlope(this);
        SSteepSlope    = new PBaseMovement_SteepSlope(this);

        /* Set State. */
        curState = SAirborne;
    }
예제 #2
0
 public LocalCollisionManager(PBaseMovement_State owner, PCollisionState collisionState) : base(owner, collisionState)
 {
 }
 public PBaseMovement_CollisionManager(PBaseMovement_State owner, PCollisionState collisionState)
 {
     this.owner          = owner;
     this.collisionState = collisionState;
     behaviour           = owner.behaviour;
 }