using System; using System.Collections.Generic; using SUISS.Core; using SUISS.Scheduling; using SUISSEngine; using UnityEngine; public class CIGFirst : MonoBehaviour { protected void Awake() { if (string.IsNullOrEmpty(this._currentSceneName)) { UnityEngine.Debug.LogError("[CIGFirst] Please define the current scene name!"); } if (!ServiceLocator.WasRegistered()) { ServiceLocator.RegistorServiceObject(new UnityScheduler()); } Singleton.Instance.SwitchLanguage(Singleton.Instance.CultureIdentifier); Screen.sleepTimeout = -1; if ((this.persistentManagerPrefabs != null && !CIGFirst._persistentManagerPrefabsLoaded.ContainsKey(this._currentSceneName)) || !CIGFirst._persistentManagerPrefabsLoaded[this._currentSceneName]) { foreach (GameObject gameObject in this.persistentManagerPrefabs) { if (gameObject != null) { UnityEngine.Object @object = UnityEngine.Object.Instantiate(gameObject); if (@object.name.Contains("Clone")) { @object.name = gameObject.name; } } else { UnityEngine.Debug.LogWarning("Null prefab in CIGFirst"); } } CIGFirst._persistentManagerPrefabsLoaded[this._currentSceneName] = true; } StorageController.Initialize(); } [SerializeField] private string _currentSceneName; public GameObject[] persistentManagerPrefabs; private static Dictionary _persistentManagerPrefabsLoaded = new Dictionary(); }