|
Nebula
|
Represents a game object that resides in a game world.
Contains properties and native components that make up the behaviour and logic of the entity. Entities can receive messages which are propagated to all properties that listen for the message.
Public Member Functions | |
| bool | HasComponent< T > () |
| Check if entity has some unmanaged component. | |
| unsafe void | SetComponent< T > (in T component) |
| Set the value of a native, unmanaged component. | |
| unsafe T | GetComponent< T > () |
| Gets a value copy of the native, unmanaged component. | |
| bool | HasProperty< T > () |
| Checks if the entity has a certain property. | |
| void | AddProperty (Property property, bool active=true) |
| Adds a property to the entity. | |
| T | GetProperty< T > () |
| Gets the property if it exists in the entity. | |
| Vector3 | GetPosition () |
| Gets the position of the entity. | |
| void | SetPosition (Vector3 position) |
| Sets the position of the entity. | |
| Quaternion | GetOrientation () |
| Gets the orientation of the entity. | |
| void | SetOrientation (Quaternion orientation) |
| Sets the orientation of the entity. | |
| Vector3 | GetScale () |
| Gets the scale of the entity. | |
| void | SetScale (Vector3 scale) |
| Sets the scale of the entity. | |
| void | Send< T > (in T msg) |
| Sends this entity a message. | |
| override string | ToString () |
| Constructs a string representation of this entity. | |
Static Public Member Functions | |
| static void | Destroy (Entity entity) |
| Schedule the entity for destruction. | |
Package Functions | |
| Entity (World world, UInt64 entityId) | |
| Property | GetProperty (Type type) |
| Gets the property by its type, for a type that is only known at runtime. | |
| void | RegisterMessage< T > (IMessageHandler< T > handler) |
| void | UnregisterMessages (Property property) |
| List< Property > | GetProperties () |
| void | ClearProperties () |
| bool | RemoveProperty (Property property) |
| Removes one property from this entity. | |
| void | Detach () |
| Release the managed side of the entity without touching the native one. | |
Properties | |
| World | World [get] |
| The world that this entity belongs to. | |
| UInt64 | Id [get] |
| Unique identifier for the entity. | |
| IReadOnlyList< Property > | Properties [get] |
| The properties of the entity, in the order they were added. | |
| Vector3 | Position [get, set] |
Private Attributes | |
| readonly World | world |
| UInt64 | id = 0xFFFFFFFFFFFFFFFF |
| List< Property > | properties |
| MsgDispatcher | dispatcher |
|
inlinepackage |
Do not create new entities using this constructor, instead create them via World.CreateEntity.
|
inline |
Adds a property to the entity.
The property is activated here when this world is simulating. In a world that is only being authored the value is recorded and OnActivate happens when the world starts simulating, which is what an editor's play button does.
|
inlinepackage |
|
inlinestatic |
Schedule the entity for destruction.
Note that this does not immediately remove the entity from the native backend.
|
inlinepackage |
Release the managed side of the entity without touching the native one.
Used when the world the entity belongs to goes away, because the native entities are gone with it and there is nothing left to delete through the api.
|
inline |
Gets a value copy of the native, unmanaged component.
This method copies the component through a stack-backed buffer.
| T | : | struct | |
| T | : | NativeComponent |
|
inline |
Gets the orientation of the entity.
|
inline |
Gets the position of the entity.
|
inlinepackage |
Gets the property by its type, for a type that is only known at runtime.
This is what the level format reads with, since a property named by a file has no type to name in the generic version.
|
inline |
Gets the property if it exists in the entity.
This is a linear search (O(N)) through all properties attached to this entity.
| T | : | Property |
|
inline |
Gets the scale of the entity.
|
inline |
Check if entity has some unmanaged component.
| T | : | struct | |
| T | : | NativeComponent |
|
inline |
Checks if the entity has a certain property.
This is a linear search (O(N)) through all properties attached to this entity.
| T | : | Property |
|
inlinepackage |
| T | : | Msg |
|
inlinepackage |
Removes one property from this entity.
This is the single property version of ClearProperties, and it is what an undo of an add takes: the command removes the property it added.
|
inline |
Sends this entity a message.
The message will be propagated into all Properties that this entity has, that accepts the message.
| T | : | Msg |
|
inline |
Set the value of a native, unmanaged component.
This method copies the component through a stack-backed buffer.
| T | : | struct | |
| T | : | NativeComponent |
|
inline |
Sets the orientation of the entity.
|
inline |
Sets the position of the entity.
|
inline |
Sets the scale of the entity.
|
inline |
Constructs a string representation of this entity.
|
inlinepackage |
|
private |
|
private |
|
private |
|
get |
Unique identifier for the entity.
|
getset |
|
getpackage |
The properties of the entity, in the order they were added.
This is what the level format writes, because the order the properties were added in is the order the file gets.
|
get |
The world that this entity belongs to.