C# Class UnityPlatformer.CharacterAction

Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: llafuente/unity-platformer Class Usage Examples

Méthodes publiques

Свойство Type Description
character Character
input PlatformerInput
onGrainControl System.Action
onLoseControl System.Action

Méthodes publiques

Méthode Description
GainControl ( float delta ) : void

Called (once) when this action is going to be 'PerformAction' for first time Can be use to enter states

GetPostUpdateActions ( ) : PostUpdateActions

Return what to do next. By default should be: APPLY_GRAVITY | WORLD_COLLISIONS

LoseControl ( float delta ) : void

Called (once) when other action 'WantsToUpdate' or this action don't anymore Can be used to exit states and clean up

OnDisable ( ) : void

keep Character.actions in sync

OnEnable ( ) : void

keep Character.actions in sync

PerformAction ( float delta ) : void

Do your action here.

WantsToUpdate ( float delta ) : int

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.\n NOTE can be used as a replace for UpdateManager.PlatformerUpdate

Method Details

GainControl() public méthode

Called (once) when this action is going to be 'PerformAction' for first time Can be use to enter states
public GainControl ( float delta ) : void
delta float
Résultat void

GetPostUpdateActions() public abstract méthode

Return what to do next. By default should be: APPLY_GRAVITY | WORLD_COLLISIONS
public abstract GetPostUpdateActions ( ) : PostUpdateActions
Résultat PostUpdateActions

LoseControl() public méthode

Called (once) when other action 'WantsToUpdate' or this action don't anymore Can be used to exit states and clean up
public LoseControl ( float delta ) : void
delta float
Résultat void

OnDisable() public méthode

keep Character.actions in sync
public OnDisable ( ) : void
Résultat void

OnEnable() public méthode

keep Character.actions in sync
public OnEnable ( ) : void
Résultat void

PerformAction() public abstract méthode

Do your action here.
public abstract PerformAction ( float delta ) : void
delta float
Résultat void

WantsToUpdate() public abstract méthode

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.\n NOTE can be used as a replace for UpdateManager.PlatformerUpdate
public abstract WantsToUpdate ( float delta ) : int
delta float
Résultat int

Property Details

character public_oe property

Target character that will be affected by this movement
public Character character
Résultat Character

input public_oe property

Input to listen
public PlatformerInput input
Résultat PlatformerInput

onGrainControl public_oe property

Callback when this movement WantsToUpdate and has highest priority.
public Action,System onGrainControl
Résultat System.Action

onLoseControl public_oe property

Callback when this movement don't WantsToUpdate or another movement has higher priority
public Action,System onLoseControl
Résultat System.Action