//Set the time between SwingStart and SwingEnd in a sword swing. private IEnumerator SwordMovement(float time) //Temp { yield return(CustomTimer.Timer(.2f)); float timeStart = time * .35f; float timeEnd = timeStart - time; CurrentSwordAttackState = SwordAttackState.SwingStart; //Start swing movement yield return(CustomTimer.Timer(timeStart)); CurrentSwordAttackState = SwordAttackState.SwingEnd; //End swing movement yield return(CustomTimer.Timer(timeEnd)); }
// COROUTINES private IEnumerator SwordMovementCoroutine(float time) //Temp { float timeStart = time * .35f; float timeEnd = timeStart - time; CurrentSwordAttackState = SwordAttackState.SwingStart; //Start swing movement yield return(CustomTimer.Timer(timeStart)); CurrentSwordAttackState = SwordAttackState.SwingEnd; //End swing movement yield return(CustomTimer.Timer(timeEnd)); //canSwing.initialBool = true; //TransitionToState(CharacterState.Default); }
private void OnDisable() { IdleState.Dispose(); MoveState.Dispose(); JumpState.Dispose(); InAirState.Dispose(); LandState.Dispose(); WallSlideState.Dispose(); LedgeClimbState.Dispose(); CrouchIdleState.Dispose(); CrouchMoveState.Dispose(); SwordAttackState.Dispose(); HandAttackState.Dispose(); AirAttackState.Dispose(); SlideState.Dispose(); }