Class Scene
Represents an abstract base class for a game scene or level. Manages the lifecycle and rendering for all GameObjects contained within it.
public abstract class Scene
- Inheritance
-
Scene
- Derived
- Inherited Members
Properties
Camera
public Camera Camera { get; set; }
Property Value
Canvas
public Canvas Canvas { get; }
Property Value
Colliders
A list of all the colliders in the Scene.
public IReadOnlyList<Collider> Colliders { get; }
Property Value
Name
The name of the Scene.
public string Name { get; }
Property Value
Methods
Add()
Adds a emptGameObject to the Scene.
public GameObject Add()
Returns
- GameObject
The added GameObject.
Add(GameObject)
Adds a GameObject to the Scene.
public void Add(GameObject gameObject)
Parameters
gameObjectGameObjectThe GameObject that wil be added.
AddCollider(Collider)
public void AddCollider(Collider collider)
Parameters
Draw(SpriteBatch)
protected virtual void Draw(SpriteBatch spriteBatch)
Parameters
spriteBatchSpriteBatch
FindAll<T>()
Finds all Components of the given type.
public T[] FindAll<T>() where T : Component
Returns
- T[]
An array of Components of type
T.
Type Parameters
TThe type of the Components to find.
FindGameObject<T>()
Finds the first GameObject of the given type.
public GameObject? FindGameObject<T>() where T : Component
Returns
- GameObject
The first GameObject of type
Tfound, ornullif none exist.
Type Parameters
TThe type of the GameObject to find.
FindGameObjects<T>()
Finds all GameObjects of the given type.
public GameObject[] FindGameObjects<T>() where T : Component
Returns
- GameObject[]
An array of GameObjects of type
T.
Type Parameters
TThe type of the GameObjects to find.
Find<T>()
Finds the first Component of the given type.
public T? Find<T>() where T : Component
Returns
- T
The first Component of type
Tfound, ornullif none exist.
Type Parameters
TThe type of the Component to find.
Initialize()
protected virtual void Initialize()
InternalDraw(SpriteBatch)
public void InternalDraw(SpriteBatch spriteBatch)
Parameters
spriteBatchSpriteBatch
InternalInitialize()
public void InternalInitialize()
InternalLoadContent()
public void InternalLoadContent()
InternalUnload()
public void InternalUnload()
InternalUpdate()
public void InternalUpdate()
LoadContent()
protected virtual void LoadContent()
Unload()
protected virtual void Unload()
Update()
protected virtual void Update()