API

Assembly: Spark.Scenes Interface: IScenesPlugin Implementation: ScenesPlugin

Interface

public interface IScenesPlugin
{
    List<SceneEntry> GetAllSceneEntries();
    SceneEntry GetSceneEntry(string sceneId);
    bool HasSceneEntry(string sceneId);
    void LoadScene(SceneEntry sceneEntry);
    void LoadSceneById(string sceneId);
    void LoadSceneByName(string sceneName);
}

Methods

GetAllSceneEntries

List<SceneEntry> GetAllSceneEntries()

Returns all scene entries in the database.

GetSceneEntry

Returns the scene entry with the given ID, or null if not found.

HasSceneEntry

Returns true if a scene entry exists with the given ID.

LoadScene / LoadSceneById / LoadSceneByName

Loads a scene using the SceneLoader system. Triggers loading screen, publishes events, and repositions the player entity on completion.

SceneEntry

Extends SparkDatabaseEntry. Defines a game scene.

Field
Type
Description

sceneFileName

string

Scene name as registered in Build Settings

defaultSpawnPosition

Vector3

Where the player spawns

defaultSpawnRotation

Vector3

Player facing direction (Euler angles)

loadingImages

List<Sprite>

Images shown during loading

Methods:

Commands

Command
Fields
Description

LoadSceneCommand

string SceneEntryId

Requests a scene load

Events

SceneLoadStartedEvent

Published when a scene begins loading.

Property
Type
Description

SceneEntryId

string

ID of the scene entry

SceneFileName

string

Scene file name

EventType: "Scenes.LoadStarted"

SceneLoadCompletedEvent

Published when a scene finishes loading.

Property
Type
Description

SceneEntryId

string

ID of the scene entry

SceneFileName

string

Scene file name

EventType: "Scenes.LoadCompleted"

SceneLoader

Static utility class that handles async scene loading with progress tracking. Integrates with LoadingScreenManager for visual feedback.

Usage

Last updated

Was this helpful?