コード例 #1
0
        public void IntantiateMappables(Country country)
        {
            if (!started)
            {
                Start();
            }

            List <MountPoint> countryMountPoints = new List <MountPoint>();

            try
            {
                int countryIndex    = worldMapGlobe.GetCountryIndex(country.name);
                int mountPointCount = worldMapGlobe.GetMountPoints(countryIndex, countryMountPoints);
            }
            catch
            {
                errorHandler.ReportError("Failed to load country's mount points", ErrorState.restart_scene);
                return;
            }

            foreach (MountPoint mountPoint in countryMountPoints)
            {
                if (mountPoint.type == START_POINT && mountPoint.provinceIndex == worldMapGlobe.GetProvinceIndex(startingCountry, startingProvince))
                {
                    int startingCellIndex = worldMapGlobe.GetCellIndex(mountPoint.localPosition);
                    if (startingCellIndex < 0 || startingCellIndex > worldMapGlobe.cells.Length)
                    {
                        errorHandler.ReportError("Invalid starting mount point", ErrorState.restart_scene);
                    }
                    else
                    {
                        Cell startingCell       = worldMapGlobe.cells[startingCellIndex];
                        bool playerInstantiated = playerManager.IntantiatePlayer(startingCell);
                    }
                }
                if (mountPoint.type == CULTURAL_POINT) //&& loadedMapSettings.culturalLandmarks)
                {
                    LandmarkManager.InstantiateCulturalLandmark(mountPoint);
                }
            }
        }