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

Push objects (Box) NOTE require CharacterActionGroundMovement More...

Inheritance diagram for UnityPlatformer.CharacterActionPull:
UnityPlatformer.CharacterAction

Public Member Functions

override void OnEnable ()
 keep Character.actions in sync More...
 
override int WantsToUpdate (float delta)
 Tells the character we want to take control More...
 
override void GainControl (float delta)
 EnterState More...
 
override void LoseControl (float delta)
 ExitState More...
 
override void PerformAction (float delta)
 Move Character, because the magic is in OnAfterMove More...
 
void OnAfterMove (Character ch, float delta)
 Move the Box after moving the character, so there is a gap between them More...
 
void PullBox (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...
 
bool forbidVerticalMovement = true
 Limit Pull movement to X More...
 
String action = "Pull"
 Input action name 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.CharacterActionPull.GainControl ( float  delta)
inlinevirtual

EnterState

Reimplemented from UnityPlatformer.CharacterAction.

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionPull.GetPostUpdateActions ( )
inlinevirtual

default

Implements UnityPlatformer.CharacterAction.

◆ LoseControl()

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

ExitState

Reimplemented from UnityPlatformer.CharacterAction.

◆ OnAfterMove()

void UnityPlatformer.CharacterActionPull.OnAfterMove ( Character  ch,
float  delta 
)
inline

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

◆ OnEnable()

override void UnityPlatformer.CharacterActionPull.OnEnable ( )
inlinevirtual

keep Character.actions in sync

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

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

Move Character, because the magic is in OnAfterMove

Implements UnityPlatformer.CharacterAction.

◆ PullBox()

void UnityPlatformer.CharacterActionPull.PullBox ( Vector3  velocity,
Directions  dir,
float  delta 
)
inline

Move a Box

◆ WantsToUpdate()

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

Tells the character we want to take control

  • Positive numbers fight: Higher number wins
  • Negative numbers are used to ignore fight and force Character to call PerformAction, but! because it doesn't win the fight onLoseControl, onGrainControl and GetPostUpdateActions are ignored.
    NOTE can be used as a replace for UpdateManager.PlatformerUpdate

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ accelerationTime

float UnityPlatformer.CharacterActionPull.accelerationTime = .1f

Time to reach max speed

◆ action

String UnityPlatformer.CharacterActionPull.action = "Pull"

Input action name

◆ forbidVerticalMovement

bool UnityPlatformer.CharacterActionPull.forbidVerticalMovement = true

Limit Pull movement to X

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

◆ priority

int UnityPlatformer.CharacterActionPull.priority = 20

Action priority

◆ speed

float UnityPlatformer.CharacterActionPull.speed = 3

Movement speed


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