WorldManager Class

Summary

WorldManager is a class that allows us to maintain a set of "worlds" that allow us to instantiate and manipulate sets of GameObjects in ASL separately from each other.
Namespace
ASL.WorldSystem
Base Types
  • MonoBehaviour
graph TD Base0["MonoBehaviour"]-->Type Type["WorldManager"] class Type type-node

Syntax

public class WorldManager : MonoBehaviour

Fields

Name Constant Value Summary
masterClient
Indicates whether the application is a master client. Only the master client can be the active creator of worlds. Other clients follow suit once they receive an ASL message indicating that a world was made.

Methods

Name Value Summary
AddToWorld(World, GameObject) void
Set an object as a child of a world, and raises an event to the other clients so their WorldManagers update to match
CreateWorld(string) void
Create a new world by prefab name, and add it to the Dictionary
FindWorlds() void
Loads any instantiated worlds into the "worlds" Dictionary
GetWorldById(int) World
Retrieve a world by its viewID (found in a PhotonView component)
getWorldByName(string) World
Retrieve a world from the Dictionary by name
InitializeAll() void
Call the init method in all of our instantiated worlds.