Represents an entity within a scene. Provides methods to manage components and query entity properties.
More...
|
| static bool | operator== (Entity lhs, Entity rhs) |
| | Compares two entities for equality.
|
| |
| static bool | operator!= (Entity lhs, Entity rhs) |
| | Compares two entities for inequality.
|
| |
| static implicit | operator bool (Entity entity) |
| | Implicit conversion to bool for null checking. Returns true if the entity is valid.
|
| |
| static bool | Remove (Component component) |
| | Removes a specified component instance from its owner.
|
| |
| static bool | Remove (Component component, float secondsDelay) |
| | Removes a specified component instance from its owner.
|
| |
|
| readonly uint | Id |
| | Gets the unique identifier of the entity.
|
| |
|
| bool | active [get] |
| | Gets or sets the wether the entity is active.
|
| |
| bool | activeLocal [get] |
| |
| string | name [get, set] |
| | Gets or sets the name of the entity.
|
| |
| string | tag [get, set] |
| | Gets or sets the tag of the entity.
|
| |
| LayerMask | layers [get, set] |
| | Gets or sets the layer of the entity.
|
| |
| TransformComponent | transform [get] |
| | Gets the transform component of the entity.
|
| |
Represents an entity within a scene. Provides methods to manage components and query entity properties.
Definition at line 14 of file Entity.cs.
◆ AddComponent< T >()
| T Unravel.Core.Entity.AddComponent< T > |
( |
| ) |
|
Adds a new component of the specified type to the entity.
- Template Parameters
-
| T | The type of component to add. |
- Returns
- The newly added component.
Definition at line 146 of file Entity.cs.
◆ Equals() [1/2]
| bool Unravel.Core.Entity.Equals |
( |
Entity | other | ) |
|
Determines whether the specified entity is equal to the current entity.
- Parameters
-
| other | The entity to compare with the current entity. |
- Returns
true if the specified entity is equal to the current entity; otherwise, false.
Definition at line 95 of file Entity.cs.
◆ Equals() [2/2]
| override bool Unravel.Core.Entity.Equals |
( |
object | obj | ) |
|
◆ GetComponent< T >()
| T Unravel.Core.Entity.GetComponent< T > |
( |
| ) |
|
Gets the component of the specified type from the entity.
- Template Parameters
-
| T | The type of component to retrieve. |
- Returns
- The component of the specified type.
Definition at line 176 of file Entity.cs.
◆ GetComponentInChildren()
| Component Unravel.Core.Entity.GetComponentInChildren |
( |
Type | type | ) |
|
Gets the first component of the specified type from the entity or any of its children.
- Parameters
-
| type | The component type to search for. |
Definition at line 221 of file Entity.cs.
◆ GetComponentInChildren< T >()
Gets the first component of the specified type from the entity or any of its children.
Definition at line 204 of file Entity.cs.
◆ GetComponents()
| Component[] Unravel.Core.Entity.GetComponents |
( |
Type | type | ) |
|
Gets all components of the specified type from the entity.
- Parameters
-
| type | The type of component to retrieve. |
- Returns
- An array of components of the specified type.
Definition at line 186 of file Entity.cs.
◆ GetComponents< T >()
Gets all components of the specified type from the entity.
- Template Parameters
-
| T | The type of component to retrieve. |
- Returns
- An array of components of the specified type.
Definition at line 196 of file Entity.cs.
◆ GetComponentsInChildren()
| Component[] Unravel.Core.Entity.GetComponentsInChildren |
( |
Type | type | ) |
|
Gets all components of the specified type from the entity and its children.
- Parameters
-
| type | The component type to search for. |
Definition at line 230 of file Entity.cs.
◆ GetComponentsInChildren< T >()
Gets all components of the specified type from the entity and its children.
Definition at line 212 of file Entity.cs.
◆ GetHashCode()
| override int Unravel.Core.Entity.GetHashCode |
( |
| ) |
|
◆ HasComponent()
| bool Unravel.Core.Entity.HasComponent |
( |
Type | type | ) |
|
Determines whether the entity has a component of the specified type.
- Parameters
-
| type | The type of component to check for. |
- Returns
true if the entity has the specified component; otherwise, false.
Definition at line 166 of file Entity.cs.
◆ HasComponent< T >()
Determines whether the entity has a component of the specified type.
- Template Parameters
-
| T | The type of component to check for. |
- Returns
true if the entity has the specified component; otherwise, false.
Definition at line 156 of file Entity.cs.
◆ IsValid()
| bool Unravel.Core.Entity.IsValid |
( |
| ) |
|
Determines whether the entity is valid within the scene.
- Returns
true if the entity is valid; otherwise, false.
Definition at line 136 of file Entity.cs.
◆ operator bool()
| static implicit Unravel.Core.Entity.operator bool |
( |
Entity | entity | ) |
|
|
static |
Implicit conversion to bool for null checking. Returns true if the entity is valid.
- Parameters
-
| entity | The entity to check. |
- Returns
true if the entity is valid; otherwise, false.
Definition at line 124 of file Entity.cs.
◆ operator!=()
| static bool Unravel.Core.Entity.operator!= |
( |
Entity | lhs, |
|
|
Entity | rhs ) |
|
static |
Compares two entities for inequality.
- Parameters
-
| lhs | The first entity. |
| rhs | The second entity. |
- Returns
true if both entities are not equal; otherwise, false.
◆ operator==()
| static bool Unravel.Core.Entity.operator== |
( |
Entity | lhs, |
|
|
Entity | rhs ) |
|
static |
Compares two entities for equality.
- Parameters
-
| lhs | The first entity. |
| rhs | The second entity. |
- Returns
true if both entities are equal; otherwise, false.
◆ Remove() [1/2]
| static bool Unravel.Core.Entity.Remove |
( |
Component | component | ) |
|
|
static |
Removes a specified component instance from its owner.
- Parameters
-
| component | The component instance to remove. |
- Returns
true if the component was successfully removed; otherwise, false.
Definition at line 240 of file Entity.cs.
◆ Remove() [2/2]
| static bool Unravel.Core.Entity.Remove |
( |
Component | component, |
|
|
float | secondsDelay ) |
|
static |
Removes a specified component instance from its owner.
- Parameters
-
| component | The component instance to remove. |
- Returns
true if the component was successfully removed; otherwise, false.
Definition at line 255 of file Entity.cs.
◆ RemoveComponent() [1/2]
| bool Unravel.Core.Entity.RemoveComponent |
( |
Component | component | ) |
|
◆ RemoveComponent() [2/2]
| bool Unravel.Core.Entity.RemoveComponent |
( |
Component | component, |
|
|
float | secondsDelay ) |
◆ RemoveComponent< T >() [1/2]
Removes a component of the specified type from the entity.
- Template Parameters
-
| T | The type of component to remove. |
- Returns
true if the component was successfully removed; otherwise, false.
Definition at line 270 of file Entity.cs.
◆ RemoveComponent< T >() [2/2]
Removes a component of the specified type from the entity.
- Template Parameters
-
| T | The type of component to remove. |
- Returns
true if the component was successfully removed; otherwise, false.
Definition at line 280 of file Entity.cs.
◆ SetActive()
| void Unravel.Core.Entity.SetActive |
( |
bool | active | ) |
|
◆ ToString() [1/3]
| override string Unravel.Core.Entity.ToString |
( |
| ) |
|
Converts the collision to its string representation.
- Returns
- A string that represents the collision.
Definition at line 289 of file Entity.cs.
◆ ToString() [2/3]
| string Unravel.Core.Entity.ToString |
( |
string | format | ) |
|
Converts the collision to its string representation with a specified format.
- Parameters
-
- Returns
- A string that represents the collision.
Definition at line 299 of file Entity.cs.
◆ ToString() [3/3]
| string Unravel.Core.Entity.ToString |
( |
string | format, |
|
|
IFormatProvider | formatProvider ) |
Converts the collision to its string representation with a specified format and format provider.
- Parameters
-
| format | The format string. |
| formatProvider | An object that supplies culture-specific formatting information. |
- Returns
- A string that represents the collision.
Definition at line 310 of file Entity.cs.
◆ Id
| readonly uint Unravel.Core.Entity.Id |
Gets the unique identifier of the entity.
Definition at line 20 of file Entity.cs.
◆ Invalid
◆ active
| bool Unravel.Core.Entity.active |
|
get |
Gets or sets the wether the entity is active.
The active state associated with the entity.
Definition at line 26 of file Entity.cs.
◆ activeLocal
| bool Unravel.Core.Entity.activeLocal |
|
get |
◆ layers
Gets or sets the layer of the entity.
The layer associated with the entity.
Definition at line 65 of file Entity.cs.
◆ name
| string Unravel.Core.Entity.name |
|
getset |
Gets or sets the name of the entity.
The name associated with the entity.
Definition at line 45 of file Entity.cs.
◆ tag
| string Unravel.Core.Entity.tag |
|
getset |
Gets or sets the tag of the entity.
The tag associated with the entity.
Definition at line 55 of file Entity.cs.
◆ transform
Gets the transform component of the entity.
The transform component of the entity.
Definition at line 75 of file Entity.cs.
The documentation for this struct was generated from the following file:
- C:/Workspace/github/UnravelEngine/UnravelEngine/engine_data/data/scripts/scene/Entity.cs