public static class HierarchyParenting: the operations that keep Parent, Child, Sibling and HierarchyDepth consistent with each other.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Four components describe one relationship, and every one of them can be written directly. Nothing stops that, and everything that does it will eventually produce a list that loops back on itself or a depth that disagrees with the parent chain. This is the only supported way to change the shape of a hierarchy, and it is what the tests are written against.
Methods (12)
public static Entity CreateTransform(World world, LocalTransform local)Creates an entity with a transform, ready to be parented and rendered.
public static Entity ParentOf(World world, Entity entity)The entity's parent, or Null if it is a root.
public static int DepthOf(World world, Entity entity)How far the entity is from a root.
public static Matrix4x4 ResolveWorldMatrix(World world, Entity entity)The entity's local-to-world matrix as it stands now, composed by walking the parent chain rather than read from WorldTransform.
public static Hierarchy.ChildSequence ChildrenOf(World world, Entity entity)The entity's children, in no guaranteed order.
public static bool IsAncestorOf(World world, Entity ancestor, Entity entity)Whether one entity is the other's ancestor.
public static void SetParentKeepingWorldPosition(World world, Entity entity, Entity parent)Reparents an entity, keeping its world position where it was.
public static void SetParent(World world, Entity entity, Entity parent)Reparents an entity, keeping its local transform and so moving it in the world.
public static void SetParentAfter(World world, Entity entity, Entity parent, Entity after)Hangs an entity from a parent at a particular place among its children.
public static Entity PreviousSiblingOf(World world, Entity entity)Which child comes before this one, or null if it is the first or has no parent.
public static void DestroySubtree(World world, Entity root)Destroys an entity and everything below it.
public static void DestroySubtree(World world, CommandBuffer commands, Entity root)Records the destruction of an entity and everything below it, for playback later.
Used by (51, showing 40)
- PlayerRigThirdPersonShooter
- ProgramEcsStressTest
- BehaviorTestsVixen.Engine.Tests
- CameraDirectorSystemVixen.Engine
- CameraDirectorTestsVixen.Engine.Tests
- CameraExtractionTestsVixen.Rendering.Tests
- HierarchyTestsVixen.Engine.Tests
- NetworkSpawnTestsVixen.Net.Engine.Tests
- NetworkSpawnerVixen.Net.Engine
- PlayerAllocationTestsVixen.Engine.Tests
- PlayerCamerasVixen.Engine
- PlayerSpawnerTestsVixen.Net.Engine.Tests
- PredictionSmoothingTestsVixen.Net.Engine.Tests
- PrefabVixen.Engine
- RigVixen.Engine.Tests
- RigVixen.Engine.Tests
- RigVixen.Engine.Tests
- RigVixen.Engine.Tests
- SceneAndPrefabTestsVixen.Engine.Tests
- SceneAssetTestsVixen.Engine.Tests
- SceneContentVixen.Engine
- SceneManagerVixen.Engine
- SiblingOrderTestsVixen.Engine.Tests
- TransformVixen.Engine
- TransformSystemVixen.Engine
- TransformSystemTestsVixen.Engine.Tests
- VirtualCameraSystemVixen.Engine
- VirtualCameraTestsVixen.Engine.Tests
- VirtualCamerasVixen.Engine
- WorldSerializerVixen.Engine
- WorldSerializerTestsVixen.Engine.Tests
- DiagnosticsModuleVixen.Editor.Diagnostics
- EditorApplicationVixen.Editor.App
- EntityGizmoTargetVixen.Editor.SceneView
- EntityLifetimeTestsVixen.Editor.SceneView.Tests
- HostedRendererTestsVixen.App.Tests
- OutlinerTestsVixen.Editor.App.Tests
- PrefabInstanceTestsVixen.Editor.AssetEditors.Tests
- ReparentCommandVixen.Editor.SceneView
- ReparentTestsVixen.Editor.SceneView.Tests