public Vector2 GetRawVelocity() { LZFighterFrame frame = CurrentFrame; LZFighterStateData state = CurrentStateData; StateMachineNode stateNode = stateMachine.CurrentState; return(frame.velocity + state.velocity + stateNode.velocity); }
public Vector2 GetVelocity() { LZFighterFrame frame = CurrentFrame; LZFighterStateData state = CurrentStateData; StateMachineNode stateNode = stateMachine.CurrentState; Vector2 velocity = frame.velocity + state.velocity + stateNode.velocity; velocity *= internalVelocityStrength; if (velocityModifier != null) { foreach (var modifier in velocityModifier.GetInvocationList()) { velocity = (Vector2)modifier.DynamicInvoke(velocity); } //velocity /= velocityModifier.GetInvocationList().Length + 1f; } if (invertHorizontal) { velocity = new Vector2(-velocity.x, velocity.y); } return(velocity); }
public void RemoveState(StateMachineNode state) { int index = states.FindIndex((s) => s == state); RemoveState(index); }