-
Notifications
You must be signed in to change notification settings - Fork 351
Playing within editor
Nako Sung edited this page Apr 27, 2016
·
10 revisions
To play with editor you must have an access to editor world
.
let editorWorld = Root.GetEngine().GetEditorWorld()
let actor = new StaticMeshActor(editorWorld)
let cubeMesh = StaticMesh.Load('/Engine/BasicShapes/Cube')
actor.RootComponent.SetWorldLocation({Z:123})
actor.StaticMeshComponent.StaticMesh = cubeMesh
$execEditor( () => {
// your code goes here to prevent exec-blocking
} )
$execTransaction( "Important operation!", () => {
yourPreciousTarget.ModifyObject(true)
yourPreciousTarget.yourPreciousProperty = "ALTERED"
yourPreciousTarget.yourPreciousMethod()
})
Editor context is not being cleaned up before map load. So every references to actors belonging to previous map should be cleaned up before map load triggered.