void Start()
        {
            errorHandler = interfaceFactory.ErrorHandler;
            gameManager  = interfaceFactory.GameManager;
            globeManager = interfaceFactory.GlobeManager;
            uiManager    = interfaceFactory.UIManager;
            if (errorHandler == null || gameManager == null || globeManager == null || uiManager == null)
            {
                gameObject.SetActive(false);
            }
            else
            {
                if (componentMissing == true)
                {
                    errorHandler.ReportError("Pathfinder missing component", ErrorState.restart_scene);
                }
                globeParser = globeManager.GlobeParser;
                if (globeParser == null)
                {
                    errorHandler.ReportError("Globe Parser missing", ErrorState.restart_scene);
                }
                worldMapGlobe = globeManager.WorldMapGlobe;
                if (worldMapGlobe == null)
                {
                    errorHandler.ReportError("World Map Globe missing", ErrorState.restart_scene);
                }
                playerManager = gameManager.PlayerManager;
                if (playerManager == null)
                {
                    errorHandler.ReportError("Player Manager missing", ErrorState.restart_scene);
                }

                CellsInRange = globeParser.GetCellsInRange(playerCharacter.CellLocation, TravelRange + 1);
            }
        }
Exemplo n.º 2
0
 private void Start()
 {
     globeManager = interfaceFactory.GlobeManager;
     errorHandler = interfaceFactory.ErrorHandler;
     if (globeManager == null || errorHandler == 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
         {
             provinceParser = globeParser.ProvinceParser;
             if (provinceParser == null)
             {
                 errorHandler.ReportError("Province Parser missing", ErrorState.restart_scene);
             }
         }
     }
 }
Exemplo n.º 3
0
        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);
                        }
                    }
                }
            }
        }