Tanoda
GILES.pb_Scene Class Reference
Inheritance diagram for GILES.pb_Scene:
GILES.pb_MonoBehaviourSingleton< pb_Scene >

Public Member Functions

void ThisIsAReload ()
 
void EnablePhysics ()
 
void EditEnvironmentToggle ()
 
void EditToolsToggle (GameObject[] tools)
 
void Clear ()
 
void RepositionTools ()
 
void LoadEnvAndTools (bool onlyTools=false)
 

Static Public Member Functions

static void AddOnObjectInstantiatedListener (Callback< GameObject > listener)
 
static void AddOnLevelLoadedListener (Callback listener)
 
static void AddOnLevelClearedListener (Callback listener)
 
static UnityEngine.GameObject Instantiate (UnityEngine.GameObject original)
 
static UnityEngine.GameObject Instantiate (UnityEngine.GameObject original, Vector3 position, Quaternion rotation)
 
static UnityEngine.GameObject Instantiate (UnityEngine.GameObject original, Vector3 position, Quaternion rotation, Transform parent)
 
static string SaveLevel ()
 
static void LoadLevel (string levelJson, bool ssol=false)
 
static void ReloadLevel (string levelJson)
 
static List< GameObject > Children ()
 

Public Attributes

bool IsLoadingEnvNow = false
 

Protected Member Functions

override void Awake ()
 
- Protected Member Functions inherited from GILES.pb_MonoBehaviourSingleton< pb_Scene >
virtual void Initialize ()
 
virtual void Awake ()
 

Events

Callback< GameObject > onObjectInstantiated
 
Callback onLevelLoaded
 
Callback onLevelCleared
 

Additional Inherited Members

- Properties inherited from GILES.pb_MonoBehaviourSingleton< pb_Scene >
virtual bool dontDestroyOnLoad [get]
 Override to maintain an instance of this object across level loads. More...
 
static T instance [get]
 
static T nullableInstance [get]
 

Detailed Description

Represents the root object of a scene graph. When adding or removing objects from the scene, make sure to register those changes with this class.

Definition at line 25 of file pb_Scene.cs.

Member Function Documentation

◆ AddOnLevelClearedListener()

static void GILES.pb_Scene.AddOnLevelClearedListener ( Callback  listener)
static

Add a callback to be notified when a pb_Scene is cleared.

Definition at line 118 of file pb_Scene.cs.

◆ AddOnLevelLoadedListener()

static void GILES.pb_Scene.AddOnLevelLoadedListener ( Callback  listener)
static

Add a callback to be notified when a pb_Scene is loaded from a file or JSON string.

Definition at line 107 of file pb_Scene.cs.

◆ AddOnObjectInstantiatedListener()

static void GILES.pb_Scene.AddOnObjectInstantiatedListener ( Callback< GameObject >  listener)
static

Notification when a new object is instantiated in the scene.

Definition at line 96 of file pb_Scene.cs.

◆ Awake()

override void GILES.pb_Scene.Awake ( )
protectedvirtual

If overriding, be sure to call base.Awake().

Reimplemented from GILES.pb_MonoBehaviourSingleton< pb_Scene >.

Definition at line 29 of file pb_Scene.cs.

◆ Children()

static List< GameObject > GILES.pb_Scene.Children ( )
static

Recursively search a transform for children and return all of 'em as a list. Does not include the root transform in list.

Definition at line 1193 of file pb_Scene.cs.

◆ Clear()

void GILES.pb_Scene.Clear ( )

Destroy all children in the scene.

Todo:
don't reference pb_Selection in pb_Scene.

Definition at line 1055 of file pb_Scene.cs.

◆ EditEnvironmentToggle()

void GILES.pb_Scene.EditEnvironmentToggle ( )

Definition at line 759 of file pb_Scene.cs.

◆ EditToolsToggle()

void GILES.pb_Scene.EditToolsToggle ( GameObject[]  tools)

Definition at line 794 of file pb_Scene.cs.

◆ EnablePhysics()

void GILES.pb_Scene.EnablePhysics ( )

Definition at line 367 of file pb_Scene.cs.

◆ Instantiate() [1/3]

static UnityEngine.GameObject GILES.pb_Scene.Instantiate ( UnityEngine.GameObject  original)
static

Wrapper around UnityEngine.GameObject.Instantiate() that makes sure the new object is correctly added to the Level Editor scenegraph. In order for objects to be saved and loaded properly, they must belong to the scenegraph.

Definition at line 133 of file pb_Scene.cs.

◆ Instantiate() [2/3]

static UnityEngine.GameObject GILES.pb_Scene.Instantiate ( UnityEngine.GameObject  original,
Vector3  position,
Quaternion  rotation 
)
static

Wrapper around UnityEngine.GameObject.Instantiate() that makes sure the new object is correctly added to the Level Editor scenegraph. In order for objects to be saved and loaded properly, they must belong to the scenegraph.

Definition at line 166 of file pb_Scene.cs.

◆ Instantiate() [3/3]

static UnityEngine.GameObject GILES.pb_Scene.Instantiate ( UnityEngine.GameObject  original,
Vector3  position,
Quaternion  rotation,
Transform  parent 
)
static

Wrapper around UnityEngine.GameObject.Instantiate() that makes sure the new object is correctly added to the Level Editor scenegraph. In order for objects to be saved and loaded properly, they must belong to the scenegraph.

Definition at line 190 of file pb_Scene.cs.

◆ LoadEnvAndTools()

void GILES.pb_Scene.LoadEnvAndTools ( bool  onlyTools = false)

Definition at line 1074 of file pb_Scene.cs.

◆ LoadLevel()

static void GILES.pb_Scene.LoadLevel ( string  levelJson,
bool  ssol = false 
)
static

Load a saved level into the scene. This clears the currently open scene.

Definition at line 238 of file pb_Scene.cs.

◆ ReloadLevel()

static void GILES.pb_Scene.ReloadLevel ( string  levelJson)
static

Definition at line 1000 of file pb_Scene.cs.

◆ RepositionTools()

void GILES.pb_Scene.RepositionTools ( )

Definition at line 1069 of file pb_Scene.cs.

◆ SaveLevel()

static string GILES.pb_Scene.SaveLevel ( )
static

Save the current level. Returns a JSON formatted string with the entire scene-graph serialized.

Definition at line 207 of file pb_Scene.cs.

◆ ThisIsAReload()

void GILES.pb_Scene.ThisIsAReload ( )

Member Data Documentation

◆ IsLoadingEnvNow

bool GILES.pb_Scene.IsLoadingEnvNow = false

Definition at line 72 of file pb_Scene.cs.

Event Documentation

◆ onLevelCleared

Callback GILES.pb_Scene.onLevelCleared

Event raised when a level cleared.

Definition at line 91 of file pb_Scene.cs.

◆ onLevelLoaded

Callback GILES.pb_Scene.onLevelLoaded

Event raised when a level is loaded.

Definition at line 86 of file pb_Scene.cs.

◆ onObjectInstantiated

Callback<GameObject> GILES.pb_Scene.onObjectInstantiated

Event raised when an object is instantiated in the scene. Passes the new object as a parameter.

Definition at line 81 of file pb_Scene.cs.


The documentation for this class was generated from the following file: