class MAGES::Interaction::BaseLocomotionProvider¶
Overview¶
The base class for locomotion providers. More…
class BaseLocomotionProvider: public MonoBehaviour, public MAGES::ILocomotionProvider { public: // properties ILocomotionSystem LocomotionSystem; LocomotionPhase LocomotionPhase; UnityEvent<LocomotionStartEventArgs> LocomotionStarted; UnityEvent<LocomotionEndEventArgs> LocomotionEnded; // methods bool CanStartLocomotion(); bool StartLocomotion(float time = 10f); bool EndLocomotion(); }; // direct descendants class SmoothMovementProvider; class SmoothTurnProvider; class SnapTurnProvider;
Inherited Members¶
public: // properties ILocomotionSystem LocomotionSystem; LocomotionPhase LocomotionPhase; UnityEvent<LocomotionStartEventArgs> LocomotionStarted; UnityEvent<LocomotionEndEventArgs> LocomotionEnded; // methods bool CanStartLocomotion(); bool StartLocomotion(float time); bool EndLocomotion();
Detailed Documentation¶
The base class for locomotion providers.
Properties¶
ILocomotionSystem LocomotionSystem
Gets or sets the locomotion system this provider is registered with.
LocomotionPhase LocomotionPhase
Gets the current locomotion phase of this provider.
UnityEvent<LocomotionStartEventArgs> LocomotionStarted
Gets or sets the event called when a locomotion has just started.
The event arguments are only valid while the event is invoked. Do not hold reference of them.
UnityEvent<LocomotionEndEventArgs> LocomotionEnded
Gets or sets the event called when a locomotion has just finished.
The event arguments are only valid while the event is invoked. Do not hold reference of them.
Methods¶
bool CanStartLocomotion()
Gets if this provider can start a locomotion.
Returns:
true
if can start a locomotion.
bool StartLocomotion(float time = 10f)
Starts a locomotion.
Parameters:
time |
The time after which the locomotion will end automatically. |
Returns:
true
if the locomotion was started successfully. ie The LocomotionSystem was not busy.
bool EndLocomotion()
Ends the locomotion.
Returns:
true
on success.