Unravel Engine C# Reference
Loading...
Searching...
No Matches
Unravel.Core.Scene Class Reference

Represents a scene in the application, providing methods to manage entities and load or destroy scenes. More...

Inheritance diagram for Unravel.Core.Scene:
Unravel.Core.Asset< Scene >

Static Public Member Functions

static void LoadScene (string key)
 Loads a scene by its unique key.
 
static void LoadScene (Scene scene)
 Loads a scene using a Scene asset.
 
static Entity Instantiate (Prefab prefab)
 Instantiates an entity from a specified prefab.
 
static Entity Instantiate (string key)
 Instantiates an entity from a prefab identified by a key.
 
static Entity CloneEntity (Entity e)
 Clones an existing entity.
 
static Entity CreateEntity (string name="Unnamed")
 Creates a new entity with the specified name.
 
static void DestroyEntity (Entity entity, float seconds=0.0f)
 Destroys the specified entity after a delay.
 
static void DestroyEntityImmediate (Entity entity)
 Immediately destroys the specified entity.
 
static bool IsEntityValid (Entity entity)
 Determines whether the specified entity is valid within the current scene.
 
static Entity FindEntityByTag (string tag)
 Finds the first entity with the specified tag.
 
static Entity[] FindEntitiesByTag (string tag)
 Finds all entities with the specified tag.
 
static Entity FindEntityByName (string name)
 Finds the first entity with the specified name.
 
static Entity[] FindEntitiesByName (string name)
 
- Static Public Member Functions inherited from Unravel.Core.Asset< Scene >
static bool operator== (Asset< T > lhs, Asset< T > rhs)
 Determines whether two Asset<T> instances are equal.
 
static bool operator!= (Asset< T > lhs, Asset< T > rhs)
 Determines whether two Asset<T> instances are not equal.
 

Additional Inherited Members

- Public Member Functions inherited from Unravel.Core.Asset< Scene >
override bool Equals (object obj)
 Determines whether the specified object is equal to the current asset.
 
bool Equals (Asset< T > other)
 Determines whether the specified Asset<T> is equal to the current asset.
 
override int GetHashCode ()
 Serves as the default hash function for the asset.
 
- Properties inherited from Unravel.Core.Asset< Scene >
Guid uid [get, set]
 Gets the unique identifier (UID) of the asset.
 

Detailed Description

Represents a scene in the application, providing methods to manage entities and load or destroy scenes.

Definition at line 9 of file Scene.cs.

Member Function Documentation

◆ CloneEntity()

static Entity Unravel.Core.Scene.CloneEntity ( Entity e)
static

Clones an existing entity.

Parameters
eThe entity to clone.
Returns
A new entity that is a clone of the specified entity.

Definition at line 54 of file Scene.cs.

◆ CreateEntity()

static Entity Unravel.Core.Scene.CreateEntity ( string name = "Unnamed")
static

Creates a new entity with the specified name.

Parameters
nameThe name to assign to the new entity. Defaults to "Unnamed".
Returns
The newly created entity.

Definition at line 64 of file Scene.cs.

◆ DestroyEntity()

static void Unravel.Core.Scene.DestroyEntity ( Entity entity,
float seconds = 0::0f )
static

Destroys the specified entity after a delay.

Parameters
entityThe entity to destroy.
secondsThe delay in seconds before destruction. Defaults to 0.

Definition at line 74 of file Scene.cs.

◆ DestroyEntityImmediate()

static void Unravel.Core.Scene.DestroyEntityImmediate ( Entity entity)
static

Immediately destroys the specified entity.

Parameters
entityThe entity to destroy.

Definition at line 86 of file Scene.cs.

◆ FindEntitiesByName()

static Entity[] Unravel.Core.Scene.FindEntitiesByName ( string name)
static

Finds all entities with the specified name.

Parameters
nameThe name to search for.
Returns
The entities with the specified name, or empty if no entities match.

Definition at line 143 of file Scene.cs.

◆ FindEntitiesByTag()

static Entity[] Unravel.Core.Scene.FindEntitiesByTag ( string tag)
static

Finds all entities with the specified tag.

Parameters
tagThe tag to search for.
Returns
The entities with the specified tag, or empty if no entities match.

Definition at line 119 of file Scene.cs.

◆ FindEntityByName()

static Entity Unravel.Core.Scene.FindEntityByName ( string name)
static

Finds the first entity with the specified name.

Parameters
nameThe name to search for.
Returns
The entity with the specified name, or invalid if no such entity exists.

Definition at line 132 of file Scene.cs.

◆ FindEntityByTag()

static Entity Unravel.Core.Scene.FindEntityByTag ( string tag)
static

Finds the first entity with the specified tag.

Parameters
tagThe tag to search for.
Returns
The entity with the specified tag, or invalid if no such entity exists.

Definition at line 109 of file Scene.cs.

◆ Instantiate() [1/2]

static Entity Unravel.Core.Scene.Instantiate ( Prefab prefab)
static

Instantiates an entity from a specified prefab.

Parameters
prefabThe prefab to instantiate.
Returns
The instantiated entity.

Definition at line 34 of file Scene.cs.

◆ Instantiate() [2/2]

static Entity Unravel.Core.Scene.Instantiate ( string key)
static

Instantiates an entity from a prefab identified by a key.

Parameters
keyThe key identifying the prefab to instantiate.
Returns
The instantiated entity.

Definition at line 44 of file Scene.cs.

◆ IsEntityValid()

static bool Unravel.Core.Scene.IsEntityValid ( Entity entity)
static

Determines whether the specified entity is valid within the current scene.

Parameters
entityThe entity to validate.
Returns
true if the entity is valid; otherwise, false.

Definition at line 99 of file Scene.cs.

◆ LoadScene() [1/2]

static void Unravel.Core.Scene.LoadScene ( Scene scene)
static

Loads a scene using a Scene asset.

Parameters
sceneThe Scene asset to load.

Definition at line 24 of file Scene.cs.

◆ LoadScene() [2/2]

static void Unravel.Core.Scene.LoadScene ( string key)
static

Loads a scene by its unique key.

Parameters
keyThe key identifying the scene to load.

Definition at line 15 of file Scene.cs.


The documentation for this class was generated from the following file: