Class ReparentCommand¶
Namespace: Apogee.Host.Editing
Assembly: Apogee.Host.dll
Gives an entity a new parent (none: a root), keeping it where it is in the world by default.
public sealed class ReparentCommand : IEditCommand
Inheritance¶
Implements¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
ReparentCommand(WorldRef, Entity, Entity, bool)¶
Gives an entity a new parent (none: a root), keeping it where it is in the world by default.
public ReparentCommand(WorldRef worldRef, Entity entity, Entity newParent, bool keepWorldTransform = true)
Parameters¶
worldRef WorldRef
entity Entity
newParent Entity
keepWorldTransform bool
Properties¶
Name¶
What the Edit menu says: "Move Cube", "Delete Light".
public string Name { get; }
Property Value¶
Methods¶
Apply()¶
Does the edit (again, when redoing).
public void Apply()
IsAllowed(World, Entity, Entity)¶
Whether entity may go under parent: not under itself or one of its own descendants, and the parent has to be a user entity (or none).
public static bool IsAllowed(World world, Entity entity, Entity parent)
Parameters¶
world World
entity Entity
parent Entity
Returns¶
TryMerge(IEditCommand)¶
Lets the command before following take it in, so that a whole drag is one step: following has been done already; the command folds its result in (its "after") and returns true.
Most commands return false.
public bool TryMerge(IEditCommand following)
Parameters¶
following IEditCommand
Returns¶
Undo()¶
public void Undo()