6 namespace HKI.Core.Init
21 [SerializeField] GameObject SplashScreenGO = null;
22 [SerializeField]
float DurationTime = 5.0f;
25 public GameObject GetSplashScrenGO {
get {
return SplashScreenGO; } }
26 public float GetDurationTime {
get {
return DurationTime; } }
30 [SerializeField] [Scene]
string MainMenuScene =
"";
31 [SerializeField]
float MinSplashScreenTime = 3.0f;
37 StartCoroutine(HandleSplashScreens());
43 if(SplashScreens == null || SplashScreens.Length == 0)
44 yield
return new WaitForSecondsRealtime(MinSplashScreenTime);
47 float remainingMinSplashScreenTime = MinSplashScreenTime;
48 float remainingDurationTime = 0.0f;
50 for(
int i = 0; i < SplashScreens.Length; i++)
52 if (SplashScreens[i].GetSplashScrenGO != null)
56 for (
int i = 0; i < SplashScreens.Length; i++)
60 if(SplashScreens[i].GetSplashScrenGO != null)
63 while(remainingDurationTime >= 0.0f)
65 remainingMinSplashScreenTime -= Time.deltaTime;
66 remainingDurationTime -= Time.deltaTime;
68 if(remainingMinSplashScreenTime <= 0.0f && Input.GetKeyDown(KeyCode.Escape))
70 SceneManager.LoadScene(MainMenuScene);
77 if(SplashScreens[i].GetSplashScrenGO != null && i != SplashScreens.Length - 1)
82 SceneManager.LoadScene(MainMenuScene);
This SplashScreenManager enables slides for a duration of time and after all slide have been shown it...
GameObject GetSplashScrenGO
This class holds all the data of a slide that is shown by the SplashScreenManager ...
IEnumerator HandleSplashScreens()
SplashScreen [] SplashScreens