Removes all children from this entity and adds the specified list of entities as the new
children.
- Parameters:
- children: The list of the new children.
- preservingWorldTransforms: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
@MainActor @preconcurrency func replaceAll<S>(_ children: S, preservingWorldTransforms: Bool = false) where S : Sequence, S.Element : Entity
Removes all children from this entity and adds the specified list of entities as the new
children.
- Parameters:
- children: The list of the new children.
- preservingWorldTransforms: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
@MainActor @preconcurrency func replaceAll<S>(_ children: S) where S : Sequence, S.Element : Entity
Removes all children from this entity and adds the specified list of entities as the new
children.
- Parameters:
- children: The list of the new children.
get · iOS 13.0+
startIndex
TypeScript
get startIndex(): Promise<number>
Swift declaration
@MainActor @preconcurrency var startIndex: Int { get }
The position of the first element in a nonempty collection. (See `Collection.startIndex`.)
get · iOS 13.0+
description
TypeScript
get description(): Promise<string>
Swift declaration
@MainActor @preconcurrency var description: String { get }
A textual representation of this instance. (See `CustomStringConvertible`.)
Moves all `children` to be children of this entity.
- Parameters:
- children: The child entities to add to the collection.
- preservingWorldTransforms: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
Adds the specified list of entity as children to this entity.
- Parameters:
- array: The child entities to add to the collection.
- preservingWorldTransforms: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
@MainActor @preconcurrency func append<S>(contentsOf sequence: S, preservingWorldTransforms: Bool = false) where S : Sequence, S.Element : Entity
Adds the specified list of entity as children to this entity.
- Parameters:
- sequence: The child entities to add to the collection.
- preservingWorldTransforms: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
Adds the specified entity as a child to this entity.
- Parameters:
- child: The child entity to add to the collection.
- preservingWorldTransform: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
model should keep its effective location and size in the
scene!)
@MainActor @preconcurrency func insert<S>(contentsOf sequence: S, beforeIndex index: Int) where S : Sequence, S.Element : Entity
Adds the specified sequence of entities to this collection in order,
directly before the entity at the given index.
- Parameters:
- sequence: A sequence of entities to add to the collection.
- index: The index of an entity to insert in front
of. If `endIndex` is provided, the
entities will be appended.
> Note: This operation can invalidate the index order of any extant entities.
Removes the specified child from this entity.
- Note: This may modify the order of the `ChildCollection`.
- Parameters:
- index: The index of the child entity to remove from the collection.
- preservingWorldTransform: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
Removes the specified child from this entity.
- Note: This may modify the order of the `ChildCollection`.
- Parameters:
- child: The child entity to remove from the collection.
- preservingWorldTransform: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)
Removes all children from this entity.
- Parameters:
- keepCapacity: `true` to keep the memory reserved for storing the children.
`false` to free the reserved memory.
- preservingWorldTransforms: `true` to preserve the world transform. `false` to
preserve the relative transform. (Use `true` if the
entities should keep its effective location and size in
the scene!)