void TypeOfSlowDown(PlayerStates state) { if (state.Equals(PlayerStates.Punch) || state.Equals(PlayerStates.Spin)) { rigidbody.drag = 0f; return; } }
public void Dash() { if (dead || frozen || stunned || inCutscene || currentState.Equals(PlayerStates.SURF)) { return; } if (dashCooldown) { earlyDashInput = true; Invoke("EndEarlyDashInput", missedInputCooldown); return; } /* * if (!grounded && airDashes < 1) { * return; * } * airDashes--; */ StartCombatStanceCooldown(); CameraShaker.MedShake(); anim.SetTrigger("Dash"); }
private void OnTriggerEnter2D(Collider2D collision) { if (State.Equals(PlayerStates.cleanedFromOil)) { DefaultAngularDragFactor = collision.gameObject.GetComponent <Rigidbody2D>().angularDrag; DefaultLinerDragFactor = collision.gameObject.GetComponent <Rigidbody2D>().drag; } collision.gameObject.GetComponent <Rigidbody2D>().angularDrag = AngularDragFactor; collision.gameObject.GetComponent <Rigidbody2D>().drag = LinerDragFactor; State = PlayerStates.stayOnOil; StartCoroutine(SetDefaultForPlayer(collision)); }
public bool validateNewAction(PlayerActions newAction) { FSMState current = getCurrentState(); PlayerStates newState = current.validateNewAction(newAction); if (newState.Equals(PlayerStates.NULL)) { return(false); } else { currentState = newState; return(true); } }
bool ApplySlowDown() // If the player has an ingredient or is running it will update velocity { return(targetState.Equals(PlayerStates.Run) || targetState.Equals(PlayerStates.Ingredient) ? false : true); }
bool ApplyRotation() // If the player is in one of the states it will not update rotation { return(currentState.Equals(PlayerStates.Spin) ? true : false); }