class MAGES::SceneGraphModule¶
Overview¶
The scene graph module base class. More…
class SceneGraphModule: public MAGES::HubModule { public: // enums enum ActionCategory; // properties AudioClip PerformSound; AudioClip UndoSound; GameObject InfoUI; GameObject WarningUI; GameObject AchievementUI; GameObject ErrorUI; Material HolographicMaterial; ResetEvent OnReset; ActionInitializedEvent OnActionInitialized; ActionPerformedEvent OnActionPerformed; ActionUndoneEvent OnActionUndone; bool AllowEventChanges; ReadOnlyCollection<BaseActionData> ActiveActions; // methods delegate void ActionInitializedEvent(BaseActionData data); delegate void ActionPerformedEvent(BaseActionData data, bool skipped); delegate void ActionUndoneEvent(BaseActionData data); delegate void ActionStateChangeEvent( BaseActionData data, ActionState previousState, ActionState newState ); delegate void ResetEvent(); void SkipAction(BaseActionData action); void PerformAction(BaseActionData action); void UndoAction(BaseActionData action); void Reset(); void Skip(); void Undo(); ActionCategory GetActionCategory(BaseActionData action); SceneGraphModule ActionInitialized(ActionInitializedEvent action); SceneGraphModule ActionPerformed(ActionPerformedEvent action); SceneGraphModule ActionUndone(ActionUndoneEvent action); SceneGraphModule ForEachAction(Action<BaseActionData> action); bool IsManagedBySceneGraph(GameObject obj); }; // direct descendants class MAGESSceneGraph; class StubSceneGraph;
Inherited Members¶
public: // properties int Version; // methods void Startup(); void Shutdown(); virtual void UpdateModule(UpdatePhase updatePhase);
Detailed Documentation¶
The scene graph module base class.
Properties¶
AudioClip PerformSound
Gets the perform sound.
AudioClip UndoSound
Gets the undo sound.
GameObject InfoUI
Gets the info UI.
GameObject WarningUI
Gets the warning UI.
GameObject AchievementUI
Gets the warning UI.
GameObject ErrorUI
Gets the error UI.
Material HolographicMaterial
Gets or sets the holographic material for the operation.
ResetEvent OnReset
Gets or sets the reset event.
ActionInitializedEvent OnActionInitialized
Gets or sets the action initialized event.
ActionPerformedEvent OnActionPerformed
Gets or sets the action performed event.
ActionUndoneEvent OnActionUndone
Gets or sets the action performed event.
bool AllowEventChanges
Gets or sets a value indicating whether it’s allowed event based changes (like trigger) to perform actions in the scene graph.
ReadOnlyCollection<BaseActionData> ActiveActions
Gets the active actions.
Methods¶
delegate void ActionInitializedEvent(BaseActionData data)
Called when the action is initialized.
Parameters:
data |
The action data. |
delegate void ActionPerformedEvent(BaseActionData data, bool skipped)
Called when the action is performed.
Parameters:
data |
The action data. |
skipped |
Whether the action was skipped. |
delegate void ActionUndoneEvent(BaseActionData data)
Called when the action is undone.
Parameters:
data |
The action data. |
delegate void ActionStateChangeEvent( BaseActionData data, ActionState previousState, ActionState newState )
Called before an action’s state is changed.
Parameters:
data |
The action. |
previousState |
The previous state. |
newState |
The new state. |
delegate void ResetEvent()
Called when the scene graph is reset.
void SkipAction(BaseActionData action)
Skips a specific action.
Parameters:
action |
The action to be skipped. |
void PerformAction(BaseActionData action)
Perform a specific action.
Parameters:
action |
The action data to perform. |
void UndoAction(BaseActionData action)
Undo a specific action.
Parameters:
action |
The action to be undone. |
void Reset()
Resets the Scenegraph. This will undo all the currently running and performed actions.
void Skip()
General version of SkipAction(BaseActionData). This will perform/skip all the currently running actions.
void Undo()
General version of UndoAction(BaseActionData). This will undo all the running actions, as well as the previous ones.
ActionCategory GetActionCategory(BaseActionData action)
Gets the action category.
Parameters:
action |
The action. |
Returns:
The category of the action.
SceneGraphModule ActionInitialized(ActionInitializedEvent action)
Add event listener for when an action is initialized.
Deprecated Better use SceneGraphModule.OnActionInitialized
Parameters:
action |
The delegate to invoke. |
Returns:
The module.
SceneGraphModule ActionPerformed(ActionPerformedEvent action)
Add event listener for when an action is performed.
Deprecated Better use SceneGraphModule.OnActionPerformed
Parameters:
action |
The delegate to invoke. |
Returns:
The module.
SceneGraphModule ActionUndone(ActionUndoneEvent action)
Add event listener for when an action is reverted.
Deprecated Better use SceneGraphModule.OnActionUndone
Parameters:
action |
The delegate to invoke. |
Returns:
The module.
SceneGraphModule ForEachAction(Action<BaseActionData> action)
Iterate through all the actions.
Parameters:
action |
The action to invoke for each action. |
Returns:
The module.
bool IsManagedBySceneGraph(GameObject obj)
Gets a value indicating whether the object is managed by the scene graph.
Parameters:
obj |
The game object (note: must be the top-level object!). |
Returns:
Whether or not the object in question is managed (i.e. created/destroyed) by the scene graph.