/// <summary> /// Executes the the act() function of the state Move /// </summary> private void HandleState() { switch (playerState) { case State.IDLE: idleMove.Act(this); break; case State.RUN: runMove.Act(this); break; case State.WALLRUN_LEFT: wallRunMoveLeft.Act(this); break; case State.WALLRUN_RIGHT: wallrunMoveRight.Act(this); break; case State.CLIMB: ClimbMove.Act(this); break; case State.SLIDE: SlideMove.Act(this); break; case State.AIRBORNE: airborneMove.Act(this); break; } }
protected override void Update() { base.Update(); if (InitialUpdate) { SimpleMovementScript.StartModule(); InitialUpdate = false; } UpdateBuffs(); if (SimpleMovementScript.IsRunning()) { if (IsFalling()) { if (!MovementTransitionManagerScript.IsCurrentTransition(ModuleTypes.Simple, ModuleTypes.Falling)) { MovementTransitionManagerScript.StartTransitionFrom(ModuleTypes.Simple, ModuleTypes.Falling); } } else { Move currentMove = SimpleMovementScript.CurrentMove; Vector3 currentVector = SimpleMovementScript.CurrentVector; if (Vector3.zero != currentVector) { Entity.transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(currentVector), 0.15F); } Entity.transform.Translate(currentVector * currentMove.Speed * Time.deltaTime, Space.World); DebugConsole.INSTANCE.SetCurrentMove(currentMove); DebugConsole.INSTANCE.SetOther1("currentVector=" + currentVector); } } else if (ClimbMovementScript.IsRunning()) { ClimbMove currentMove = ClimbMovementScript.CurrentMove; Vector3 currentVector = ClimbMovementScript.CurrentVector; Entity.transform.Translate(currentVector * ClimbSpeed.GetSpeed(currentMove.Climb) * Time.deltaTime, Space.World); DebugConsole.INSTANCE.SetCurrentMove(currentMove); DebugConsole.INSTANCE.SetOther1("currentVector=" + currentVector); } }
public void SetPreviousMove(ClimbMove inMovementType) { previousMove.text = "Direction: " + inMovementType.Direction + ", Climb: " + inMovementType.Climb; }
public void SetCurrentMove(ClimbMove inMovementType) { currentMove.text = "Direction: " + inMovementType.Direction + ", Climb: " + inMovementType.Climb; }