class MAGES::Interaction::LocomotionSystem

Overview

The locomotion system responsible for managing access to the Rig. More…

class LocomotionSystem:
    public MonoBehaviour,
    public MAGES::ILocomotionSystem
{
public:
    // properties

    IPlayerRig Rig;
    ILocomotionProvider ExclusiveProvider;
    bool IsBusy;
    UnityEvent<ExclusiveAccessGrantedEventArgs> ExclusiveAccessGranted;
    UnityEvent<ExclusiveAccessFinishedEventArgs> ExclusiveAccessEnded;

    // methods

    bool RequestExclusiveAccess(ILocomotionProvider provider, float timeout = 0f);
    bool EndExclusiveAccess(ILocomotionProvider provider);
};

Inherited Members

public:
    // properties

    IPlayerRig Rig;
    ILocomotionProvider ExclusiveProvider;
    UnityEvent<ExclusiveAccessGrantedEventArgs> ExclusiveAccessGranted;
    UnityEvent<ExclusiveAccessFinishedEventArgs> ExclusiveAccessEnded;
    bool IsBusy;

    // methods

    bool RequestExclusiveAccess(ILocomotionProvider provider, float timeout);
    bool EndExclusiveAccess(ILocomotionProvider provider);

Detailed Documentation

The locomotion system responsible for managing access to the Rig.

Properties

IPlayerRig Rig

Gets or sets the Rig that is being controlled.

ILocomotionProvider ExclusiveProvider

Gets the current provider that is performing an exclusive operation. null if not busy.

bool IsBusy

Gets a value indicating whether the system is busy with an exclusive operation.

UnityEvent<ExclusiveAccessGrantedEventArgs> ExclusiveAccessGranted

Gets the event called when the exclusive access is granted.

UnityEvent<ExclusiveAccessFinishedEventArgs> ExclusiveAccessEnded

Gets the event called when the exclusive access is finished.

Methods

bool RequestExclusiveAccess(ILocomotionProvider provider, float timeout = 0f)

Start an exclusive operation with the Rig.

Parameters:

provider

The provider with which to start the operation.

timeout

The time in seconds after which the exclusive access will finish.

Returns:

true if the operation was started successfully.

bool EndExclusiveAccess(ILocomotionProvider provider)

Finish an exclusive operation with the Rig.

Parameters:

provider

The provider to end the operation.

Returns:

true if the provider was performing an exclusive operation that was now ended successfully.