-
Notifications
You must be signed in to change notification settings - Fork 2
UDBase.Controllers.SceneSystem
Helper class for async scene loading
public class UDBase.Controllers.SceneSystem.AsyncLoadHelper
: MonoBehaviour
Properties
Type | Name | Summary |
---|---|---|
Single |
Progress |
Methods
Type | Name | Summary |
---|---|---|
void |
LoadScene(String sceneName, Action<String> callback) |
Asynchronous scene loader
public class UDBase.Controllers.SceneSystem.AsyncSceneLoader
: IScene
Properties
Type | Name | Summary |
---|---|---|
ISceneInfo |
CurrentScene |
Methods
Type | Name | Summary |
---|---|---|
void |
LoadScene(ISceneInfo sceneInfo) |
|
void |
LoadScene(String sceneName) |
|
void |
LoadScene(T type) |
|
void |
LoadScene(T type, String param) |
|
void |
LoadScene(T type, String[] parameters) |
|
void |
ReloadScene() |
Synchronous scene loader
public class UDBase.Controllers.SceneSystem.DirectSceneLoader
: IScene
Properties
Type | Name | Summary |
---|---|---|
ISceneInfo |
CurrentScene |
Methods
Type | Name | Summary |
---|---|---|
void |
LoadScene(ISceneInfo sceneInfo) |
|
void |
LoadScene(String sceneName) |
|
void |
LoadScene(T type) |
|
void |
LoadScene(T type, String param) |
|
void |
LoadScene(T type, String[] parameters) |
|
void |
ReloadScene() |
IScene provide several methods to load scenes: By name - simpliest method. By some type and parameters - move specific and flexible. For example, you have some scene structure like that (or much more complicated): - MainMenu (loaded by name) Level_1, Level_2, .., Level_N (custom type with parameter) Your custom class/struct needs to inherit from ISceneInfo and implement Name property with your custom logics. Another simple option you can use is enum like Scenes { MainMenu, Level }, which can be used in both cases: LoadScene(Scenes.MainMenu) => loads "MainMenu" LoadScene(Scenes.Level, "1") => loads "Level_1"
public interface UDBase.Controllers.SceneSystem.IScene
Properties
Type | Name | Summary |
---|---|---|
ISceneInfo |
CurrentScene | Info of current loaded scene |
Methods
Type | Name | Summary |
---|---|---|
void |
LoadScene(ISceneInfo sceneInfo) |
Loads the scene by specific info |
void |
LoadScene(String sceneName) |
Loads the scene by specific info |
void |
LoadScene(T type) |
Loads the scene by specific info |
void |
LoadScene(T type, String param) |
Loads the scene by specific info |
void |
LoadScene(T type, String[] parameters) |
Loads the scene by specific info |
void |
ReloadScene() | Reloads the current scene. |
Interface for scene information
public interface UDBase.Controllers.SceneSystem.ISceneInfo
Properties
Type | Name | Summary |
---|---|---|
String |
Name |
Multi scene parameter - custom type with >1 parameters. Example: Level_Type1_1, Level_TypeN_N, etc.
public struct UDBase.Controllers.SceneSystem.MultiSceneParam<T>
: ISceneInfo
Properties
Type | Name | Summary |
---|---|---|
String |
Name | |
String[] |
Params | |
String |
Type |
Event which fired when scene was changed
public struct UDBase.Controllers.SceneSystem.Scene_Loaded
Properties
Type | Name | Summary |
---|---|---|
ISceneInfo |
SceneInfo |
Scene info factory
public static class UDBase.Controllers.SceneSystem.SceneInfo
Static Methods
Type | Name | Summary |
---|---|---|
ISceneInfo |
Get(T type) |
|
ISceneInfo |
Get(T type, String param) |
|
ISceneInfo |
Get(T type, String[] param) |
Basic scene info - requires only name. Example: MainMenu, Settings, etc.
public struct UDBase.Controllers.SceneSystem.SceneName
: ISceneInfo
Properties
Type | Name | Summary |
---|---|---|
String |
Name |
Methods
Type | Name | Summary |
---|---|---|
String |
ToString() |
Specific info - custom type and (optional) parameter. Example: Level_1, Level_N, etc.
public struct UDBase.Controllers.SceneSystem.SceneParam<T>
: ISceneInfo
Properties
Type | Name | Summary |
---|---|---|
String |
Name | |
String |
Param | |
String |
Type |