Modular First Person Player 1.0.2.7
|
Classes | |
class | CameraSettings |
class | CollisionSettings |
Player collision settings. More... | |
class | ControlSettings |
Player input controls settings. More... | |
class | FootstepSettings |
Player footstep settings. More... | |
class | MainSettings |
Main player settings. More... | |
class | MovementSettings |
Player movement settings. More... | |
class | Settings |
Base class for player settings. More... | |
Public Member Functions | |
delegate void | OnAiredHandler () |
Event delegate when the character just aired. | |
delegate void | OnLandedHandler (Vector3 velocity) |
Event delegate when the character just landed. | |
delegate void | OnFootstepHandler (AudioClip footstep, float volume, float pitch) |
Event delegate when the character just emitted a footstep. | |
delegate void | BeforeFinalMovementHandler (Vector3 finalMovement) |
Event delegate just before applying the final movement. | |
delegate void | AfterFinalMovementHandler (Vector3 finalMovement) |
Event delegate just after applying the final movement. | |
delegate void | CollisionDetectedHandler (ControllerColliderHit hit) |
Event delegate when a collision with this Player is detected. | |
void | AddForce (Vector3 force) |
Adds a force to this Player. | |
void | AddImpulse (Vector3 impulse) |
Adds an impulse to this Player. | |
void | TeleportTo (Vector3 position, bool resetVelocity=true) |
Teleports the player to a specified position. | |
void | EmitFootstepSound () |
Emits a footstep sound. | |
void | EmitJumpSound () |
Emits a jumping sound. | |
void | EmitLandSound (float velocityMagnitude) |
Emits a landing sound. | |
Protected Member Functions | |
virtual void | BeforeUpdate () |
Executed before the Update. | |
virtual void | AfterUpdate () |
Executed after the Update. | |
void | DoMouse () |
Mouse movement. | |
void | DoMovement () |
Character movement. | |
void | UpdateHeight () |
Update the height of the Player. | |
void | DoMisc () |
void | DoFootsteps () |
Footstep updating. | |
float | GetAxis (string axisName) |
Similar to Input.GetAxis(string) but also taking into account ControlSettings.ControlsEnabled. | |
float | GetAxisRaw (string axisName) |
Similar to Input.GetAxisRaw(string) but also taking into account ControlSettings.ControlsEnabled. | |
float | GetCurrentAxis (string axisName) |
Returns the current axis value, based on whetever we use ControlSettings.RawInput and also taking into account ControlSettings.ControlsEnabled. | |
bool | GetButton (string buttonName) |
Similar to Input.GetButton(string) but also taking into account ControlSettings.ControlsEnabled. | |
bool | GetButtonDown (string buttonName) |
Similar to Input.GetButtonDown(string) but also taking into account ControlSettings.ControlsEnabled. | |
bool | GetButtonUp (string buttonName) |
Similar to Input.GetButtonUp(string) but also taking into account ControlSettings.ControlsEnabled. | |
Vector3 | AirAccelerate (Vector3 wishDir, Vector3 velocity, float accelerate) |
Applies air accelerate for a certain wished direction and the current velocity we're going at. | |
Properties | |
IEnumerable< PlayerModule > | Modules [get] |
All of the modules attached to this Player. | |
MainSettings | Main [get, set] |
Main settings. | |
CameraSettings | CameraExtras [get, set] |
Extra camera settings. | |
ControlSettings | Controls [get, set] |
Control input settings. | |
CollisionSettings | Collisions [get, set] |
Collision settings. | |
MovementSettings | Movement [get, set] |
Character movement settings. | |
FootstepSettings | Footstep [get, set] |
Footstep sounds settings. | |
CharacterController | CharacterController [get] |
The attached UnityEngine.CharacterController to this Player. | |
float | MinMoveDistance [get, set] |
The minimum move distance of this CharacterController, same as UnityEngine.CharacterController.minMoveDistance | |
float | Radius [get, set] |
The radius of this CharacterController, same as UnityEngine.CharacterController.radius | |
float | RadiusWithSkinWidth [get] |
The radius combined with the skin width of this CharacterController | |
float | SkinWidth [get, set] |
The skin width of this CharacterController, same as UnityEngine.CharacterController.skinWidth | |
float | SlopeLimit [get, set] |
The slope limit in degrees of this CharacterController, same as UnityEngine.CharacterController.slopeLimit | |
float | StepOffset [get, set] |
The step offset in meters of this CharacterController, same as UnityEngine.CharacterController.stepOffset | |
Vector2 | LookAngles [get, set] |
The look angles of the Player. | |
Vector2 | LookAnglesDelta [get, set] |
The look angles delta of the Player. | |
Vector2 | TargetLookAngles [get, set] |
The target look angles of the Player unaffected by mouse smoothing. | |
Vector3 | DesiredMovement [get, protected set] |
The desired movement of the Player in local space. | |
Vector3 | DesiredWorldMovement [get, protected set] |
The desired movement of the Player in world space. | |
Vector3 | NormalizedDesiredMovement [get, protected set] |
The normalized desired movement of the Player in local space. | |
Vector3 | NormalizedDesiredWorldMovement [get, protected set] |
The normalized desired movement of the Player in world space. | |
Vector3 | FinalMovement [get, set] |
The final movement of the Player when calling UnityEngine.CharacterController.Move(Vector3) | |
Vector3 | Velocity [get] |
The velocity of this CharacterController. Does not include additional speeds like kinematic movement. | |
Vector3 | PlanarVelocity [get] |
The planar velocity (X and Z only) of this CharacterController. Does not include additional speeds like kinematic movement. | |
Vector3 | TotalVelocity [get, protected set] |
The total velocity of this CharacterController, kinematic movement included. | |
float | TargetSpeed [get] |
The target speed magnitude of this Player. | |
bool | IsGrounded [get] |
Is this Player grounded? | |
bool | IsFalling [get] |
Is this Player falling? | |
bool | IsStepOffsetting [get, protected set] |
Is this Player applying a step offset? | |
bool | OldIsStepOffsetting [get, protected set] |
Was this Player applying a step offset in the previous frame? | |
bool | JustLanded [get] |
Did this Player just land? | |
bool | JustAired [get] |
Did this Player just air? | |
bool | IsSprinting [get] |
Is this Player sprinting? | |
bool | IsJumping [get] |
Is this Player jumping? | |
bool | IsCrouching [get] |
Is this Player crouching? | |
bool | CrouchToggled [get] |
Has this Player toggled crouch? | |
bool | Jumped [get, protected set] |
Has this Player jumped? | |
float | MovementDetectionThreshold [get, set] |
Movement detection threshold for IsMoving, WantsToMove, IsAscending, IsDescending (By default 0.001). | |
bool | IsMoving [get] |
Is this Player moving? (Excluding kinematic movement) | |
bool | WantsToMove [get] |
Does this Player want to move? (Excluding kinematic movement, jumping and crouching) | |
bool | IsAscending [get] |
Is this Player ascending? (Excluding kinematic movement) | |
bool | IsDescending [get] |
Is this Player descending? (Excluding kinematic movement) | |
float | SlopeRadiusMultiplier [get] |
The radius multiplier of the slope limit of this CharacterController. | |
virtual FootstepAsset.Data | CurrentFootstepData [get] |
The current footstep data activated based on the Material or Texture we're standing on. | |
bool | OldIsGrounded [get, protected set] |
Was this Player grounded in the previous frame? | |
Vector3 | OldVelocity [get, protected set] |
The velocity of this Player in the previous frame. | |
Vector3 | ForceBuffer [get, set] |
The force buffer that awaits execution for the next frame. | |
Vector3 | ImpulseBuffer [get, set] |
The impulse buffer that awaits execution for the next frame. | |
float | CurrentHeight [get, protected set] |
The current height of this Player. | |
float | CurrentCameraHeight [get, protected set] |
The current camera height of this Player. | |
float | CurrentSpeedMultiplier [get, protected set] |
The current speed multiplier of this Player (CurrentSlopeSpeedMultiplier not included). | |
float | CurrentSlopeSpeedMultiplier [get, protected set] |
The current slope speed multiplier of this Player. | |
int | CollisionLayers [get] |
The collision layers that this Player collides into, see Physics window to change collision layers. | |
float | FootstepTimer [get, set] |
The footstep timer interval left before emitting a footstep. | |
Vector3 | KinematicMovement [get, protected set] |
The kinematic movement of this Player, also known as the pushing/pulling force of other kinematic Rigidbody(ies). | |
Vector3 | OldKinematicMovement [get, protected set] |
The kinematic movement of this Player performed in the previous frame. | |
Vector3 | KinematicAngles [get, protected set] |
The kinematic angular movement, useful for rotating the Player as we rotate along a kinematic body. | |
List< Collider > | CollidingColliders [get, protected set] |
The list of colliders that are colliding with this Player in this frame. | |
List< ControllerColliderHit > | ColliderHits [get, protected set] |
The list of collider hit info of this Player in this frame. | |
Events | |
OnAiredHandler | OnAired |
Event when the character just aired. | |
OnLandedHandler | OnLanded |
Event when the character just landed. | |
OnFootstepHandler | OnFootstep |
Event when the character just emitted a footstep. | |
BeforeFinalMovementHandler | BeforeFinalMovement |
Event just before applying the final movement. | |
AfterFinalMovementHandler | AfterFinalMovement |
Event just after applying the final movement. | |
CollisionDetectedHandler | CollisionDetected |
Event when a collision with this Player is detected. | |
void MFPP.Player.AddForce | ( | Vector3 | force | ) |
Adds a force to this Player.
force | The force. |
void MFPP.Player.AddImpulse | ( | Vector3 | impulse | ) |
Adds an impulse to this Player.
impulse | The impulse. |
delegate void MFPP.Player.AfterFinalMovementHandler | ( | Vector3 | finalMovement | ) |
Event delegate just after applying the final movement.
finalMovement | The final movement vector. |
|
protected |
Applies air accelerate for a certain wished direction and the current velocity we're going at.
wishDir | The wished direction. |
velocity | The current velocity. |
accelerate | The accelerate amount we want to apply. |
delegate void MFPP.Player.BeforeFinalMovementHandler | ( | Vector3 | finalMovement | ) |
Event delegate just before applying the final movement.
finalMovement | The final movement vector. |
delegate void MFPP.Player.CollisionDetectedHandler | ( | ControllerColliderHit | hit | ) |
Event delegate when a collision with this Player is detected.
hit | The collision hit info. |
void MFPP.Player.EmitLandSound | ( | float | velocityMagnitude | ) |
Emits a landing sound.
velocityMagnitude | The velocity magnitude. |
|
protected |
Similar to Input.GetAxis(string) but also taking into account ControlSettings.ControlsEnabled.
axisName | The name of the axis. |
|
protected |
Similar to Input.GetAxisRaw(string) but also taking into account ControlSettings.ControlsEnabled.
axisName | The name of the axis. |
|
protected |
Similar to Input.GetButton(string) but also taking into account ControlSettings.ControlsEnabled.
buttonName | The name of the button. |
|
protected |
Similar to Input.GetButtonDown(string) but also taking into account ControlSettings.ControlsEnabled.
buttonName | The name of the button. |
|
protected |
Similar to Input.GetButtonUp(string) but also taking into account ControlSettings.ControlsEnabled.
buttonName | The name of the button. |
|
protected |
Returns the current axis value, based on whetever we use ControlSettings.RawInput and also taking into account ControlSettings.ControlsEnabled.
axisName | The axis name. |
delegate void MFPP.Player.OnFootstepHandler | ( | AudioClip | footstep, |
float | volume, | ||
float | pitch ) |
Event delegate when the character just emitted a footstep.
footstep | The footstep sound. |
volume | The volume of the footstep. |
pitch | The pitch of the footstep. |
delegate void MFPP.Player.OnLandedHandler | ( | Vector3 | velocity | ) |
Event delegate when the character just landed.
velocity | The velocity at which the character just landed. |
void MFPP.Player.TeleportTo | ( | Vector3 | position, |
bool | resetVelocity = true ) |
Teleports the player to a specified position.
position | The position. |
resetVelocity | Should we reset the velocity of the player? |