platformer
Public Member Functions | Public Attributes | List of all members
UnityPlatformer.CharacterActionHorizontalMovement Class Reference

Movement while on ground and not slipping More...

Inheritance diagram for UnityPlatformer.CharacterActionHorizontalMovement:
UnityPlatformer.CharacterAction UnityPlatformer.CharacterActionAirMovement UnityPlatformer.CharacterActionCrounchMovement UnityPlatformer.CharacterActionGroundMovement

Public Member Functions

override void OnEnable ()
 keep Character.actions in sync More...
 
void OnActionDown (string _action)
 input.onActionDown More...
 
void OnActionUp (string _action)
 input.onActionUp More...
 
void Clear ()
 Reset SmoothDamp More...
 
override void PerformAction (float delta)
 Do horizontal movement More...
 
void Move (float spdy, ref float smoothing, float accTime)
 Horizontal movement based on current input More...
 
override PostUpdateActions GetPostUpdateActions ()
 Return what to do next. More...
 
- Public Member Functions inherited from UnityPlatformer.CharacterAction
void Reset ()
 Try to set character & input from parent nodes More...
 
virtual void OnDisable ()
 keep Character.actions in sync More...
 
virtual void GainControl (float delta)
 Called (once) when this action is going to be 'PerformAction' for first time More...
 
virtual void LoseControl (float delta)
 Called (once) when other action 'WantsToUpdate' or this action don't anymore More...
 
abstract int WantsToUpdate (float delta)
 Tells the character we want to take control More...
 

Public Attributes

float speed = 3
 (Walking) Movement speed More...
 
float accelerationTime = .1f
 (Walking) Time to reach max speed More...
 
float runSpeed = 6
 (Running) Movement speed More...
 
float runAccelerationTime = .1f
 (Running) Time to reach max speed More...
 
bool alwaysRun = true
 Do not walk? More...
 
string runAction = "Run"
 Input action name for start running (not used if alwaysRun=true) More...
 
- Public Attributes inherited from UnityPlatformer.CharacterAction
Character character
 Target character that will be affected by this movement More...
 
PlatformerInput input
 Input to listen More...
 
Action onGrainControl
 Callback when this movement WantsToUpdate and has highest priority. More...
 
Action onLoseControl
 Callback when this movement don't WantsToUpdate or another movement has higher priority More...
 

Detailed Description

Movement while on ground and not slipping

Member Function Documentation

◆ Clear()

void UnityPlatformer.CharacterActionHorizontalMovement.Clear ( )
inline

Reset SmoothDamp

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionHorizontalMovement.GetPostUpdateActions ( )
inlinevirtual

Return what to do next.

By default should be: APPLY_GRAVITY | WORLD_COLLISIONS

Implements UnityPlatformer.CharacterAction.

◆ Move()

void UnityPlatformer.CharacterActionHorizontalMovement.Move ( float  spdy,
ref float  smoothing,
float  accTime 
)
inline

Horizontal movement based on current input

◆ OnActionDown()

void UnityPlatformer.CharacterActionHorizontalMovement.OnActionDown ( string  _action)
inline

input.onActionDown

◆ OnActionUp()

void UnityPlatformer.CharacterActionHorizontalMovement.OnActionUp ( string  _action)
inline

input.onActionUp

◆ OnEnable()

override void UnityPlatformer.CharacterActionHorizontalMovement.OnEnable ( )
inlinevirtual

keep Character.actions in sync

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

override void UnityPlatformer.CharacterActionHorizontalMovement.PerformAction ( float  delta)
inlinevirtual

Do horizontal movement

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ accelerationTime

float UnityPlatformer.CharacterActionHorizontalMovement.accelerationTime = .1f

(Walking) Time to reach max speed

◆ alwaysRun

bool UnityPlatformer.CharacterActionHorizontalMovement.alwaysRun = true

Do not walk?

◆ runAccelerationTime

float UnityPlatformer.CharacterActionHorizontalMovement.runAccelerationTime = .1f

(Running) Time to reach max speed

◆ runAction

string UnityPlatformer.CharacterActionHorizontalMovement.runAction = "Run"

Input action name for start running (not used if alwaysRun=true)

◆ runSpeed

float UnityPlatformer.CharacterActionHorizontalMovement.runSpeed = 6

(Running) Movement speed

◆ speed

float UnityPlatformer.CharacterActionHorizontalMovement.speed = 3

(Walking) Movement speed


The documentation for this class was generated from the following file: