protected virtual void Start() { gameManager = interfaceFactory.GameManager; globeManager = interfaceFactory.GlobeManager; errorHandler = interfaceFactory.ErrorHandler; uiManager = interfaceFactory.UIManager; if (gameManager == null || globeManager == null || errorHandler == null || uiManager == null) { gameObject.SetActive(false); } else { cellCursorInterface = globeManager.CellCursorInterface; if (cellCursorInterface == null) { errorHandler.ReportError("Cell Cursor Interface Missing", ErrorState.restart_scene); } else { mouseCellClicker = cellCursorInterface.CellClicker; if (mouseCellClicker == null) { errorHandler.ReportError("Mouse Cell Clicker Missing", ErrorState.restart_scene); } } } }
protected override void Start() { base.Start(); if (gameObject.activeSelf) { globeManager = interfaceFactory.GlobeManager; uiManager = interfaceFactory.UIManager; if (globeManager == null || uiManager == null) { gameObject.SetActive(false); } else { worldMapGlobe = globeManager.WorldMapGlobe; if (worldMapGlobe == null) { errorHandler.ReportError("World Map Globe Missing", ErrorState.restart_scene); } globeParser = globeManager.GlobeParser; if (globeParser == null) { errorHandler.ReportError("Globe Parser missing", ErrorState.restart_scene); } else { countryParser = globeParser.CountryParser; if (countryParser == null) { errorHandler.ReportError("Country Parser missing", ErrorState.restart_scene); } provinceParser = globeParser.ProvinceParser; if (provinceParser == null) { errorHandler.ReportError("Province Parser missing", ErrorState.restart_scene); } } cellCursorInterface = globeManager.CellCursorInterface; if (cellCursorInterface == null) { errorHandler.ReportError("Cell Cursor Interface missing", ErrorState.restart_scene); } else { cellClicker = cellCursorInterface.CellClicker; if (cellClicker == null) { errorHandler.ReportError("Cell Clicker missing", ErrorState.restart_scene); } } } } }
void Start() { gameManager = interfaceFactory.GameManager; globeManager = interfaceFactory.GlobeManager; errorHandler = interfaceFactory.ErrorHandler; if (gameManager == null || globeManager == null || errorHandler == null) { gameObject.SetActive(false); } else { cellCursorInterface = globeManager.CellCursorInterface; if (cellCursorInterface == null) { errorHandler.ReportError("CellCurserInterface no found", ErrorState.restart_scene); } } }
void Awake() { interfaceFactory = FindObjectOfType <InterfaceFactory>(); if (interfaceFactory == null) { gameObject.SetActive(false); } try { cellCursorInterface = GetComponent(typeof(ICellCursorInterface)) as ICellCursorInterface; } catch { componentMissing = true; } if (cellCursorInterface == null) { componentMissing = true; } }
void Start() { globeManager = interfaceFactory.GlobeManager; errorHandler = interfaceFactory.ErrorHandler; uiManager = interfaceFactory.UIManager; if (globeManager == null || errorHandler == null || uiManager == null) { gameObject.SetActive(false); } else { if (componentMissing) { errorHandler.ReportError("GameManager component missing", ErrorState.restart_scene); } ICellCursorInterface cellCursorInterface = globeManager.CellCursorInterface; if (cellCursorInterface == null) { errorHandler.ReportError("CellCursorInterface Missing", ErrorState.restart_scene); } cellClicker = cellCursorInterface.CellClicker; if (cellClicker == null) { errorHandler.ReportError("CellClicker Missing", ErrorState.restart_scene); } gameMenuUI = uiManager.GameMenuUI; if (gameMenuUI == null) { errorHandler.ReportError("Game Menu UI Missing", ErrorState.restart_scene); } gameAmbience.Play(); } }