WorldSceneDetails - jimdroberts/FishMMO GitHub Wiki
Serializable data structure containing configuration details for a game scene. Includes client limits, transition visuals, spawn/respawn positions, teleporters, and boundaries.
-
public int MaxClients
The maximum number of clients allowed in this scene.
-
public Sprite SceneTransitionImage
The image displayed during scene transitions.
-
public CharacterInitialSpawnPositionDictionary InitialSpawnPositions
Dictionary of initial spawn positions for characters entering the scene.
-
public CharacterRespawnPositionDictionary RespawnPositions
Dictionary of respawn positions for characters after death or re-entry.
-
public SceneTeleporterDictionary Teleporters
Dictionary of teleporters available in the scene, mapping teleporter IDs to their details.
-
public SceneBoundaryDictionary Boundaries
Dictionary of boundaries that define the playable area of the scene.
- Use this class as a serializable field or property in a scene manager or configuration asset.
- Assign values for
MaxClients
,SceneTransitionImage
, and populate the dictionaries for spawns, respawns, teleporters, and boundaries. - Integrate with scene loading and management systems to enforce limits and provide correct spawn/teleport behavior.
// Example 1: Creating a WorldSceneDetails instance
WorldSceneDetails details = new WorldSceneDetails {
MaxClients = 100,
SceneTransitionImage = someSprite,
// Populate InitialSpawnPositions, RespawnPositions, Teleporters, and Boundaries as needed
};
// Example 2: Using WorldSceneDetails in a manager
[SerializeField]
private WorldSceneDetails sceneDetails;
- Always set
MaxClients
to a reasonable value for your scene's design and server capacity. - Use clear, unique keys in all dictionaries to avoid conflicts.
- Ensure all referenced assets (sprites, dictionaries) are assigned and valid.
- Keep scene configuration data organized and version-controlled for easy updates.