/* * Execute order!!! * IMPORATNT - tohle jako první kód vůbec!!!! */ void Awake() { #region -- LOAD DAT // Data z Resources PoolObjectSO[] poole_object_types = Resources.LoadAll <PoolObjectSO>(Settings.POOL_OBJECTS_PATH); // Načteme soubory z resources highlightMaterial = Resources.Load <Material>(Settings.MATERIALS + "/" + Settings.HIGHLIGHT_MAT); // Načteme si objekty do poolu objectsToPool = new GeneralObjectPool(poole_object_types.OfType <PoolObjectSO>().ToList()); // Inicializujeme pool objekty objectsToPool.InitializeObjectsToPool(); #endregion #region -- LOAD KAMERY Settings.isGameLoaded = ManagerLoad.LoadCamera(); if (Settings.loadedScenes == null) { Debug.LogError("Nepodařilo se načíst hlavní kameru."); } // Debug.Log(Settings.isGameLoaded); #endregion #region -- LOAD SCÉN Settings.loadedScenes = Settings.GetLoadedScenes(); // TODO: Podle mě je to zbytečné if (Settings.loadedScenes == null) { Debug.LogError("Nepodařilo se získat načtené scény."); } /* * 1. Loadneme UI */ Settings.isGameLoaded = ManagerLoad.LoadScreenUIScene(); if (!Settings.isGameLoaded) { Debug.LogError("Nepodařilo se načíst scrren UI scénu."); } /* * 2. Vytvoříme WorldBuilder(pokud neni) */ Settings.isGameLoaded = ManagerLoad.LoadWorldBuilder(); if (!Settings.isGameLoaded) { Debug.LogError("Nepodařilo se načíst WorldBuilder."); } #endregion #region -- LOAD GIZMOS // Grida Settings.isGameLoaded = ManagerLoad.LoadGizmos(); #endregion }
// Start is called before the first frame update void Start() { #region -- ODSTRAŇĚNÍ NECHTĚNÝCH PRVKŮ // Ostatní kamery Settings.isGameLoaded = ManagerLoad.RemoveOtherCameras(); if (!Settings.isGameLoaded) { Debug.LogError("Cam system fail (Nepodařilo se odstranit ostatní kamery.)"); } #endregion // Inicializace UI statických tlačítek. UI.InitializeScreenStaticUI(); // Pozn. Je to až po loadu celé scény, protože se snažíme zabránit tomu callu Mnageru, nebo WorldBuilderu - singletonů }