Vixen
02b45cc4
csharp
public sealed class CreateEntityCommand

Creating an entity, undoably.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ The entity is created by Do and not by the constructor. A command that had already done its work before being executed would do it twice on a redo — and the handle a redo produces has to be the same one, which is what makes the snapshot the right way to undo it.

Fields and properties (3)

  • public string Name

    What this is called in the undo history, as a person would say it.

  • public Entity Entity

    The entity, once Do has run.

  • public Action<Entity>? Initialise

    What to put on the entity beyond a transform and a name, if anything.

Methods (5)

  • public CreateEntityCommand(SceneDocument document, string name, LocalTransform local, Entity parent = default(Entity))

    Describes creating an entity.

  • public void Do(EditorContext context)

    Applies the change.

  • public void Undo(EditorContext context)

    Puts back exactly what Do changed.

  • public bool TryMergeWith(IEditorCommand previous, out IEditorCommand? merged)

    Absorbs the entry below this one, so that the two become one undo step.

  • public void Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Used by (1)

  • SceneDocumentVixen.Editor.SceneView