Represents an entity within a scene. Provides methods to manage components and query entity properties.
More...
|
void | SetActive (bool active) |
|
override bool | Equals (object obj) |
|
bool | Equals (Entity other) |
| Determines whether the specified entity is equal to the current entity.
|
|
override int | GetHashCode () |
|
bool | IsValid () |
| Determines whether the entity is valid within the scene.
|
|
T | AddComponent< T > () |
| Adds a new component of the specified type to the entity.
|
|
bool | HasComponent< T > () |
| Determines whether the entity has a component of the specified type.
|
|
bool | HasComponent (Type type) |
| Determines whether the entity has a component of the specified type.
|
|
T | GetComponent< T > () |
| Gets the component of the specified type from the entity.
|
|
Component[] | GetComponents (Type type) |
| Gets all components of the specified type from the entity.
|
|
T[] | GetComponents< T > () |
| Gets all components of the specified type from the entity.
|
|
T | GetComponentInChildren< T > () |
|
T[] | GetComponentsInChildren< T > () |
| Gets all components of the specified type from the entity and its children.
|
|
Component | GetComponentInChildren (Type type) |
| Gets the first component of the specified type from the entity or any of its children.
|
|
Component[] | GetComponentsInChildren (Type type) |
| Gets all components of the specified type from the entity and its children.
|
|
bool | RemoveComponent< T > () |
| Removes a component of the specified type from the entity.
|
|
bool | RemoveComponent< T > (float secondsDelay) |
| Removes a component of the specified type from the entity.
|
|
override string | ToString () |
| Converts the collision to its string representation.
|
|
string | ToString (string format) |
| Converts the collision to its string representation with a specified format.
|
|
string | ToString (string format, IFormatProvider formatProvider) |
| Converts the collision to its string representation with a specified format and format provider.
|
|
|
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 15 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 147 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 96 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 177 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 222 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 205 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 187 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 197 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 231 of file Entity.cs.
◆ GetComponentsInChildren< T >()
Gets all components of the specified type from the entity and its children.
Definition at line 213 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 167 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 157 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 137 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 125 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
.
◆ RemoveComponent() [1/2]
static bool Unravel.Core.Entity.RemoveComponent |
( |
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 241 of file Entity.cs.
◆ RemoveComponent() [2/2]
static bool Unravel.Core.Entity.RemoveComponent |
( |
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 251 of file Entity.cs.
◆ 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 261 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 271 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 280 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 290 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 301 of file Entity.cs.
◆ Id
readonly uint Unravel.Core.Entity.Id |
Gets the unique identifier of the entity.
Definition at line 21 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 27 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 66 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 46 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 56 of file Entity.cs.
◆ transform
Gets the transform component of the entity.
The transform component of the entity.
Definition at line 76 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