// Use this for initialization void Start() { if (ContentGridMap == null) { Debug.Log("###### ContentGridMap is Empty"); return; } //_scriptMap =GetComponentInParent<PaletteMapController>(); _scriptMap = ContentGridMap.GetComponent <PaletteMapController>(); if (_scriptMap == null) { Debug.Log("###### scriptMap is Empty"); return; } BorderCellPalette.SetActive(false); }
private void InitComponents() { Debug.Log("..................InitComponents"); //var camera = MainCamera; if (MainCamera == null) { Debug.Log("MainCamera null"); return; } _GenWorld = UIController.GetComponent <GenericWorldManager>(); if (_GenWorld == null) { Debug.Log("########## InitComponents _GenWorld is Empty"); return; } _scriptData = MainCamera.GetComponent <SaveLoadData>(); if (_scriptData == null) { Debug.Log("Storage.Start : sctiptData not load !!!"); return; } _scriptGrid = MainCamera.GetComponent <GenerateGridFields>(); if (_scriptGrid == null) { Debug.Log("Storage.Start : scriptGrid not load !!!"); return; } m_DispatcherWorldActions = MainCamera.GetComponent <DispatcherWorldActions>(); if (m_DispatcherWorldActions == null) { Debug.Log("Storage.Start : DispatcherWorldActions not load !!!"); return; } //_scriptNPC = MainCamera.GetComponent<CreateNPC>(); //if (_scriptNPC == null) //{ // Debug.Log("Storage.Start scriptNPC not load !!!!!"); // return; //} _scriptMapWorld = MainCamera.GetComponent <MapWorld>(); if (_scriptMapWorld == null) { Debug.Log("Storage.Start scriptMapWorld not load !!!!!"); return; } _screiptHero = HeroObject.GetComponent <CompletePlayerController>(); if (_screiptHero == null) { Debug.Log("Storage.Start scriptHero not load !!!!!"); return; } if (UIController == null) { Debug.Log("Storage.Start UIController not setting !!!!!"); return; } _scriptUIEvents = UIController.GetComponent <UIEvents>(); if (_scriptUIEvents == null) { Debug.Log("Storage.Start scriptUIEvents not load !!!!!"); return; } //Reinit Component _StorageCorrect = DataStorage.GetComponent <StorageCorrect>(); if (_StorageCorrect != null) { //Debug.Log("InitObjectsGrid Destroy(_StorageCorrect) __________________________"); Destroy(_StorageCorrect); } _StorageCorrect = DataStorage.AddComponent <StorageCorrect>(); //Reinit Component _StoragePerson = MainCamera.GetComponent <StoragePerson>(); _StoragePerson.Init(); //_StoragePerson.PersonsDataInit(); _Palette = DataStorage.GetComponent <ManagerPalette>(); if (_Palette == null) { Debug.Log("########## InitComponents _Palette is Empty"); return; } _Palette.LoadSpritePrefabs(); //111111111 _SceneDebuger = UIController.GetComponent <SceneDebuger>(); if (_SceneDebuger == null) { Debug.Log("########## InitComponents _SceneDebuger is Empty"); return; } _PlayerManager = GetComponent <PlayerManager>(); if (_PlayerManager == null) { Debug.Log("########## InitComponents PlayerManager is Empty"); return; } _PlayerManager.Init(); _TilesManager = DataStorage.GetComponent <DataTilesManager>(); if (_TilesManager == null) { Debug.Log("########## InitComponents _TilesManager is Empty"); return; } _PaletteMapController = ContentGridPaletteMap.GetComponent <PaletteMapController>(); if (_PaletteMapController == null) { Debug.Log("########## InitComponents _PaletteMapController is Empty"); return; } _PaletteMapController.Init(); _DrawGeom = GetComponent <DrawGeometry>(); if (_DrawGeom == null) { Debug.Log("########## InitComponents _DrawGeom is Empty"); return; } _SceneLight = GetComponent <SceneLighting>(); if (_SceneLight == null) { Debug.Log("########## InitComponents _SceneLight is Empty"); return; } _PoolObgects = new PoolGameObjects(); _DiskData = GetComponent <DiskData>(); if (_DiskData == null) { Debug.Log("########## InitComponents _DiskData is Empty"); return; } _MoveCamera = UIController.GetComponent <MovementCamera>(); if (_MoveCamera == null) { Debug.Log("########## InitComponents _MoveCamera is Empty"); return; } _Portals = UIController.GetComponent <ManagerPortals>(); if (_Portals == null) { Debug.Log("########## InitComponents _Portals is Empty"); return; } //_PoolObgects //DrawGeometry }