5 namespace HKI.Core.Scenes
13 [SerializeField] [Scene]
string LoadingScene =
"";
15 [SerializeField] GameObject SceneLoaderControllerPrefab = null;
19 [SerializeField]
bool DoFading =
true;
20 [SerializeField]
float FadeInTime = 1.0f;
21 [SerializeField]
float FadeOutTime = 1.0f;
24 GameObject sceneLoaderControllerGO = null;
30 if(
string.IsNullOrEmpty(LoadingScene))
31 Debug.LogError(
"(SceneLoader) the LoadingScene is null!");
33 if(SceneLoaderControllerPrefab != null)
35 sceneLoaderControllerGO = GameObject.Instantiate<GameObject>(SceneLoaderControllerPrefab);
38 if(sceneLoaderController == null)
39 Debug.LogError(
"(SceneLoader) the SceneLoaderControllerPrefab has no SceneLoaderController attached to it!");
41 DontDestroyOnLoad(sceneLoaderControllerGO);
44 Debug.LogError(
"(SceneLoader) the SceneLoaderControllerPrefab is null!");
50 if(sceneLoaderControllerGO != null)
51 Destroy(sceneLoaderControllerGO);
57 if(sceneLoaderController != null)
58 sceneLoaderController.
ChangInfoText(textLocalization, TextLanguage);
60 Debug.LogError(
"(SceneLoader) you are trying to change the info text but there is no SceneLoaderController available. (Maybe the loading scene doesn't have one or you are using direct load)");
65 return sceneLoaderController;
71 LoadScene(scene,
true);
76 LoadScene(scene,
false);
81 if(sceneLoaderController == null)
83 Debug.LogError(
"(SceneLoader) you are trying to load a scene but there is no SceneLoaderController available. (Maybe the loading scene doesn't have one or you are using direct load)");
98 if (sceneLoaderController == null)
100 Debug.LogError(
"(SceneLoader) you are trying to load a scene but there is no SceneLoaderController available. (Maybe the loading scene doesn't have one or you are using direct load)");
104 sceneLoaderController.
LoadScene(LoadingScene, scene, directLoad, FadeInTime, FadeOutTime, DoFading);
This interface allows the initialization of anything by the Initialzer.
void LoadSceneAdditively(string scene)
This function will load a scene to the existing scene additively.
This ScriptableObject contains as a container for all text localization information.
void LoadScene(string scene, bool directLoad)
void ChangeText(TextLocalization textLocalization)
void LoadSceneIndirect(string scene)
This ScriptableObject spawns the SceneLoaderController prefab and gives access to the SceneLoaderCont...
void LoadSceneDirect(string scene)
Special Variable enables the use of the SystemLanguage data type as a variable of the settings system...
void LoadSceneAdditively(string scene)
This MonoBehaviour controls scene changing and the blending of the fading overlay for scene transitio...
SceneLoaderController GetSceneLoaderController()
void LoadScene(string loadingScene, string scene, bool directLoad=true, float fadeInTime=1.0f, float fadeOutTime=1.0f, bool doFading=true)
This function is for switching from one scene to another.
void ChangInfoText(TextLocalization textLocalization, Language textLanguage)