class PlayInEditor

Inherits: IScriptExportable

Handles functionality specific to running the game in editor.

Public

Constructors

PlayInEditor

PlayInEditor(const SPtr<SceneInstance> &sceneInstance)

Methods

GetState

PlayInEditorState GetState() const

Returns the current play state of the game.

SetState

void SetState(PlayInEditorState state)

Updates the play state of the game, making the game stop or start running.

Note the actual state change will be delayed until the next update() call. Use the onPlay/onStopped/onPaused/onUnpaused event to get notified when the change actually happens.

GetScene

SPtr<SceneInstance> GetScene() const

Returns the scene that will be played when entering PIE.

FrameStep

void FrameStep()

Runs the game for a single frame and then pauses it.

staticCreate

static SPtr<PlayInEditor> Create(const SPtr<SceneInstance> &sceneInstance)

Creates a new play in editor object associated with the provided scene instance.

Fields

OnPlay

Event<void ()> OnPlay

Triggered right after the play mode is entered.

OnStopped

Event<void ()> OnStopped

Triggered right after the play mode is exited.

OnPaused

Event<void ()> OnPaused

Triggered right after the user pauses play mode.

OnUnpaused

Event<void ()> OnUnpaused

Triggered right after the user unpauses play mode.

Internal

Methods

Update

void Update()

Called once per frame.

Private

Methods

SetStateImmediate

void SetStateImmediate(PlayInEditorState state)

Updates the play state of the game, making the game stop or start running.

Unlike setState() this will trigger the state change right away.

SaveSceneInMemory

void SaveSceneInMemory()

Saves the current state of the scene in memory.

SetSystemsPauseState

void SetSystemsPauseState(bool paused)

Pauses or unpauses all pausable engine systems.

Fields

mAssociatedScene

SPtr<SceneInstance> mAssociatedScene

mState

mNextState

mFrameStepActive

bool mFrameStepActive

mScheduledStateChange

bool mScheduledStateChange

mSavedSceneGameObjectCollection

SPtr<GameObjectCollection> mSavedSceneGameObjectCollection

mSavedScene

HSceneObject mSavedScene

mSavedSceneInstanceData

UnorderedMap<UUID, SPtr<GameObjectInstanceData>> mSavedSceneInstanceData

mSavedSceneResourceId

UUID mSavedSceneResourceId