Example #1
0
    public void SelectOnCountry()
    {
        if (GameMapManager.SelectedCountryManager != null)
        {
            GameCountryManager = GameWorldManager.WorldCountryManagement.FirstOrDefault(e => e.CountryGovernment.CountryOfGovernment.name == wmslObj.countryHighlighted.name);
            if (GameCountryManager != null)
            {
                GameMapManager.DebugText.text = string.Format("SELET {0}, {1}", GameCountryManager.name, GameCountryManager.CountryGovernment.MapLookUpName);
                gameObject.SetActive(true);
                wmslObj.FlyToCountry(GameCountryManager.CountryGovernment.MapLookUpName, 1f, wmslObj.lastKnownZoomLevel);
                GameMapManager.DebugText.text = string.Format("elected Country Government {0}", wmslObj.countryHighlighted.name);
                GovernmentName.text           = wmslObj.countryHighlighted.name;
                CountryNationals.text         = GameCountryManager.CountryGovernment.TitleOfPopulation;
                CountryFounding.text          = GameCountryManager.CountryGovernment.FoundingYear.ToString();
                CaptialName.text = GameCountryManager.CountryGovernment.CaptialName;
                GameMapManager.GameMapSelectedType = MapSelected.Country;
            }
            else
            {
                GameMapManager.DebugText.text = string.Format("Missing Government {0}", wmslObj.countryHighlighted.name);
                gameObject.SetActive(false);
                GovernmentName.text = wmslObj.countryHighlighted.name;
                wmslObj.FlyToCountry(wmslObj.countryHighlighted.name, 1f, wmslObj.lastKnownZoomLevel);
            }

            // SetPanelsByModeOnClick();
            ColorizeCountry();
        }
        else
        {
            // relations
            GameMapManager.DebugText.text = "NO RELATIONS OPEN EMBASSY";
        }
    }
    void Start()
    {
        App app    = UnityEngine.Object.FindObjectOfType <App>();
        var folder = Directory.CreateDirectory(Application.persistentDataPath);


        //  Market market = new Market();
        State.turn = 1;
        State.SetEra(MyEnum.Era.Early);
        State.setGamePhase(MyEnum.GamePhase.adminstration);
        State.market.InitializeMarket();

        autoSave    = app.GetAutoSave();
        humanNation = app.GetHumanNation();
        scenario    = app.GetScenario();

        map = WMSK.instance;

        ApplyScenarioDataToMap();
        map.renderViewportCurvature = -2.5f;

        map.Redraw();
        ToggleHumanPlayer();
        InitializeNation initializer = new InitializeNation();

        foreach (Nation nation in nations.Values)
        {
            initializer.InitializeThisNation(nation);
        }
        ColourContries();
        CreateMiniMap();
        // PlaceResourcesOnMap();
        cheat();
        // CreateTariffTable();
        InitializeTechnologies();


        deactivateGUIs();

        // Debug.Log("Child Count " + cultureHand.transform.childCount);

        State.initializeTacticCards();
        State.createTacticCardDeck();
        State.initalizeCultureCards();

        testCards();

        headerValues.assignHeaderValues();

        Texture2D cursorTexture = Resources.Load <Texture2D>("Sprites/mousepointer") as Texture2D;

        Cursor.SetCursor(cursorTexture, hotSpot, cursorMode);

        Nation human = State.getNations()[app.GetHumanIndex()];

        State.refillTurnOrder();

        map.FlyToCountry(app.GetHumanIndex(), 1.5f, 0.365f);
        // map.VGOToggleGroupVisibility(0, false);
    }
        void Start()
        {
            // Get a reference to the World Map API:
            map = WMSK.instance;

            // UI Setup - non-important, only for this demo
            labelStyle                        = new GUIStyle();
            labelStyle.alignment              = TextAnchor.MiddleCenter;
            labelStyle.normal.textColor       = Color.white;
            labelStyleShadow                  = new GUIStyle(labelStyle);
            labelStyleShadow.normal.textColor = Color.black;
            buttonStyle                       = new GUIStyle(labelStyle);
            buttonStyle.alignment             = TextAnchor.MiddleLeft;
            buttonStyle.normal.background     = Texture2D.whiteTexture;
            buttonStyle.normal.textColor      = Color.white;

            // setup GUI resizer - only for the demo
            GUIResizer.Init(800, 500);

            /* Register events: this is optionally but allows your scripts to be informed instantly as the mouse enters or exits a country, province or city */
            map.OnCityEnter     += (int cityIndex) => Debug.Log("Entered city " + map.cities [cityIndex].name);
            map.OnCityExit      += (int cityIndex) => Debug.Log("Exited city " + map.cities [cityIndex].name);
            map.OnCityClick     += (int cityIndex) => Debug.Log("Clicked city " + map.cities [cityIndex].name);
            map.OnProvinceEnter += (int provinceIndex, int regionIndex) => Debug.Log("Entered province " + map.provinces [provinceIndex].name);
            map.OnProvinceExit  += (int provinceIndex, int regionIndex) => Debug.Log("Exited province " + map.provinces [provinceIndex].name);
            map.OnProvinceClick += (int provinceIndex, int regionIndex) => Debug.Log("Clicked province " + map.provinces [provinceIndex].name);

            map.FlyToCountry("France", 3, 0.05f);
        }
Example #4
0
        void Start()
        {
            // Get a reference to the World Map API:
            map = WMSK.instance;

            // UI Setup - non-important, only for this demo
            labelStyle                         = new GUIStyle();
            labelStyle.alignment               = TextAnchor.MiddleCenter;
            labelStyle.normal.textColor        = Color.white;
            labelStyleShadow                   = new GUIStyle(labelStyle);
            labelStyleShadow.normal.textColor  = Color.black;
            buttonStyle                        = new GUIStyle(labelStyle);
            buttonStyle.alignment              = TextAnchor.MiddleLeft;
            buttonStyle.normal.background      = Texture2D.whiteTexture;
            buttonStyle.normal.textColor       = Color.white;
            colorPicker                        = gameObject.GetComponent <ColorPicker> ();
            sliderStyle                        = new GUIStyle();
            sliderStyle.normal.background      = Texture2D.whiteTexture;
            sliderStyle.fixedHeight            = 4.0f;
            sliderThumbStyle                   = new GUIStyle();
            sliderThumbStyle.normal.background = Resources.Load <Texture2D> ("GUI/thumb");
            sliderThumbStyle.overflow          = new RectOffset(0, 0, 8, 0);
            sliderThumbStyle.fixedWidth        = 20.0f;
            sliderThumbStyle.fixedHeight       = 12.0f;

            // setup GUI resizer - only for the demo
            GUIResizer.Init(800, 500);

            /* Register events: this is optionally but allows your scripts to be informed instantly as the mouse enters or exits a country, province or city */
            map.OnCellEnter += (int cellIndex) => Debug.Log("Entered cell #" + cellIndex + " at row " + map.cells[cellIndex].row + ", column " + map.cells[cellIndex].column);
            map.OnCellExit  += (int cellIndex) => Debug.Log("Exited cell #" + cellIndex + " at row " + map.cells[cellIndex].row + ", column " + map.cells[cellIndex].column);
            map.OnCellClick += (int cellIndex) => {
                int row = map.cells[cellIndex].row;
                int col = map.cells[cellIndex].column;
                Debug.Log("Clicked cell #" + cellIndex + " at row " + row + ", column " + col + ", center = " + map.cells[cellIndex].center);
                if (enableFadeOut)
                {
                    FadeOutCells(row, col);
                }
            };

            map.SetZoomLevel(0.3f);
            map.showGrid = true;
            cellsCount   = map.gridColumns;

            map.FlyToCountry("Spain", 0, 0.17f);
        }
        // Utility functions called from OnGUI:

        void FlyToCountry(int countryIndex)
        {
            map.FlyToCountry(countryIndex, 2.0f);
            map.BlinkCountry(countryIndex, Color.green, Color.black, 3.0f, 0.2f);
        }
        // Utility functions called from OnGUI:

        void FlyToCountryAndBlinkIt(string countryName)
        {
            map.FlyToCountry(countryName, 2.0f);
            map.BlinkCountry(countryName, Color.green, Color.black, 3.0f, 0.2f);
        }