Action

Fields

Field

Description

State

Is the event active or not?

Methods

SubscribeToStart

PUT SubscribeTo(Event newEvent)

Invoking this method will subscribe the event you pass to this Action, making it a listener to the start event.

Path Parameters

Name
Type
Description

newEvent

object

Determines the method you want to subscribe to this Action's start.

private void OnAim(){
    Debug.Log("Aiming!");
}

PlayerEvents.Aim.SubscribeToStart(OnAim);

SubscribeToStop

PUT SubscribeToStop(Event newEvent)

Invoking this method will subscribe the event you pass to this Action, making it a listener to the stop event.

Path Parameters

Name
Type
Description

newEvent

object

Determines the method you want to subscribe to this Action's stop.

private void OnAim(){
    Debug.Log("Aiming!");
}

PlayerEvents.Aim.SubscribeToStop(OnAim);

AddStartTrier

PUT AddStartTrier(TryDelegate newTrier)

Invoking this method will make the function you passed the new start trier for this Action.

Path Parameters

Name
Type
Description

newTrier

boolean

Function with a return type of boolean that will be used as a trier for this Action.

private bool OnTry_Aim(){
    if(canAim)
        return true;
    else
        return false;
}

PlayerEvents.Aim.AddStartTrier(OnTry_Aim);

AddStopTrier

PUT AddStopTrier(TryDelegate newTrier)

Invoking this method will make the function you passed the new stop trier for this Action.

Path Parameters

Name
Type
Description

newTrier

boolean

Function with a return type of boolean that will be used as a trier for this Action.

private bool OnTryStop_Aim(){
    if(canAim)
        return true;
    else
        return false;
}

PlayerEvents.Aim.AddStopTrier(OnTryStop_Aim);

TryStart

POST TryStart()

Invoking this method will try to start this Action, meaning that it will first invoke the triers and make sure they all return true before starting.

PlayerEvents.Aim.TryStart();

TryStop

POST TryStop()

Invoking this method will try to stop this Action, meaning it will first invoke the triers and make sure they all return before properly stopping it.

PlayerEvents.Aim.TryStop();

ForceStart

POST ForceStart()

Invoking this method will allow you to directly skip over the triers and start the Action.

PlayerEvents.Aim.ForceStart();

ForceStop

POST ForceStop()

Invoking this method will allow you to directly skip over the triers and stop the Action. This forceful approach is necessary sometimes.

PlayerEvents.Aim.ForceStop();

ForceToggle

POST ForceToggle()

Invoking this method will forcefully switch the Action's state. Actions that are started will be forcefully stopped, and ones that are stopped will be forcefully started.

if(Input.GetKeyCode(KeyCode.C))
    PlayerEvents.Crouch.ForceToggle();

Debug

OPTIONS Debug(bool debugAttempts = false, string name = "Debug")

Logs the names of the methods subscribed to this Attempt, and the Triers added.

Path Parameters

Name
Type
Description

Name

string

Simple name that you can give this debug, making it easier to not confuse it when debugging other things.

DebugAttempts

boolean

​Determines whether you want to debug the triers of this attempt, or only the listeners.

Last updated

Was this helpful?