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

Push objects (Box) More...

Inheritance diagram for UnityPlatformer.CharacterActionPush:
UnityPlatformer.CharacterAction

Public Member Functions

override void OnEnable ()
 keep Character.actions in sync More...
 
override int WantsToUpdate (float delta)
 Pushing and object enough time? More...
 
override void GainControl (float delta)
 EnterState and start centering More...
 
override void LoseControl (float delta)
 EnterState and start centering More...
 
override void PerformAction (float delta)
 Move Character, because the magic is in OnBeforeMove More...
 
void OnBeforeMove (Character ch, float delta)
 Move the Box before moving the character so there is a gap between them More...
 
void PushBox (Vector3 velocity, Directions dir, float delta)
 Move a Box More...
 
override PostUpdateActions GetPostUpdateActions ()
 default 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...
 

Public Attributes

float speed = 3
 Movement speed More...
 
float accelerationTime = .1f
 Time to reach max speed More...
 
float pushingStartTime = 0.5f
 Time to pushing before start moving the object More...
 
bool forbidVerticalMovement = true
 Limit Push to X More...
 
int priority = 20
 Action priority 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

Push objects (Box)

NOTE require CharacterActionGroundMovement

Member Function Documentation

◆ GainControl()

override void UnityPlatformer.CharacterActionPush.GainControl ( float  delta)
inlinevirtual

EnterState and start centering

Reimplemented from UnityPlatformer.CharacterAction.

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionPush.GetPostUpdateActions ( )
inlinevirtual

default

Implements UnityPlatformer.CharacterAction.

◆ LoseControl()

override void UnityPlatformer.CharacterActionPush.LoseControl ( float  delta)
inlinevirtual

EnterState and start centering

Reimplemented from UnityPlatformer.CharacterAction.

◆ OnBeforeMove()

void UnityPlatformer.CharacterActionPush.OnBeforeMove ( Character  ch,
float  delta 
)
inline

Move the Box before moving the character so there is a gap between them

◆ OnEnable()

override void UnityPlatformer.CharacterActionPush.OnEnable ( )
inlinevirtual

keep Character.actions in sync

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

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

Move Character, because the magic is in OnBeforeMove

Implements UnityPlatformer.CharacterAction.

◆ PushBox()

void UnityPlatformer.CharacterActionPush.PushBox ( Vector3  velocity,
Directions  dir,
float  delta 
)
inline

Move a Box

◆ WantsToUpdate()

override int UnityPlatformer.CharacterActionPush.WantsToUpdate ( float  delta)
inlinevirtual

Pushing and object enough time?

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ accelerationTime

float UnityPlatformer.CharacterActionPush.accelerationTime = .1f

Time to reach max speed

◆ forbidVerticalMovement

bool UnityPlatformer.CharacterActionPush.forbidVerticalMovement = true

Limit Push to X

if false, you will see problems while on slopes, but maybe it's desired...

◆ priority

int UnityPlatformer.CharacterActionPush.priority = 20

Action priority

◆ pushingStartTime

float UnityPlatformer.CharacterActionPush.pushingStartTime = 0.5f

Time to pushing before start moving the object

◆ speed

float UnityPlatformer.CharacterActionPush.speed = 3

Movement speed


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