private void Awake() { interfaceFactory = FindObjectOfType <InterfaceFactory>(); if (interfaceFactory == null) { gameObject.SetActive(false); } try { mappablesManager = GetComponent(typeof(IMappablesManager)) as IMappablesManager; if (mappablesManager == null) { componentMissing = true; } } catch { componentMissing = true; } }
private void Start() { gameManager = interfaceFactory.GameManager; errorHandler = interfaceFactory.ErrorHandler; globeManager = interfaceFactory.GlobeManager; if (gameManager == null || errorHandler == null || globeManager == null) { gameObject.SetActive(false); } else { touristManager = gameManager.TouristManager; if (touristManager == null) { errorHandler.ReportError("Tourist Manager missing", ErrorState.close_window); } worldMapGlobe = globeManager.WorldMapGlobe; if (worldMapGlobe == null) { errorHandler.ReportError("World Map Globe missing", ErrorState.close_window); } mappablesManager = globeManager.MappablesManager; if (mappablesManager == null) { errorHandler.ReportError("Mappables Manager missing", ErrorState.close_window); } else { landmarkManager = mappablesManager.LandmarkManager; if (landmarkManager == null) { errorHandler.ReportError("Landmark Manager missing", ErrorState.close_window); } } started = true; } }