Scene Class
Definition
Namespace: Brine2D.Engine
Base class for game scenes. Override OnLoadAsync, OnEnter, OnUpdate, OnRender, OnExit, and OnUnloadAsync to implement scene logic. Framework properties \(Logger, World, Renderer, Input, Audio, Game\) are set automatically before OnLoadAsync is called.
Inheritance System.Object → SceneBase → Scene
Derived
↳ DefaultFallbackScene
Example
C#
protected override void OnEnter()
{
var player = World.CreateEntity("Player")
.AddComponent<TransformComponent>()
.AddBehavior<PlayerMovementBehavior>();
Audio.PlayMusic("theme.ogg");
World.GetSystem<ParticleSystem>()!.IsEnabled = false;
}
| Properties | |
|---|---|
| World | Entity world for this scene. Available from OnLoadAsync onwards. Virtual to allow test doubles to substitute a lightweight world without a real ECS setup. |