Table of Contents

Class Scene

Namespace
MonoEight.Core.Scenes
Assembly
MonoEight.Template.dll

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

The Camera of the Scene.

public Camera Camera { get; set; }

Property Value

Camera

Canvas

The Canvas of the Scene.

public Canvas Canvas { get; }

Property Value

Canvas

Colliders

A list of all the colliders in the Scene.

public IReadOnlyList<Collider> Colliders { get; }

Property Value

IReadOnlyList<Collider>

Name

The name of the Scene.

public string Name { get; }

Property Value

string

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

gameObject GameObject

The GameObject that wil be added.

AddCollider(Collider)

Adds a Collider to the Scene.

public void AddCollider(Collider collider)

Parameters

collider Collider

The Collider that wil be added.

Draw(SpriteBatch)

protected virtual void Draw(SpriteBatch spriteBatch)

Parameters

spriteBatch SpriteBatch

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

T

The 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 T found, or null if none exist.

Type Parameters

T

The 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

T

The 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 T found, or null if none exist.

Type Parameters

T

The type of the Component to find.

Initialize()

protected virtual void Initialize()

InternalDraw(SpriteBatch)

public void InternalDraw(SpriteBatch spriteBatch)

Parameters

spriteBatch SpriteBatch

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()