Пример #1
0
        void Start()
        {
            // UI Setup - non-important, only for this demo
            labelStyle                        = new GUIStyle();
            labelStyle.alignment              = TextAnchor.MiddleLeft;
            labelStyle.normal.textColor       = Color.white;
            labelStyleShadow                  = new GUIStyle(labelStyle);
            labelStyleShadow.normal.textColor = Color.black;
            buttonStyle                       = new GUIStyle(labelStyle);
            buttonStyle.alignment             = TextAnchor.MiddleCenter;
            buttonStyle.normal.background     = Texture2D.whiteTexture;
            buttonStyle.normal.textColor      = Color.black;

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

            // WMSK setup
            map              = WMSK.instance;
            map.OnCellClick += HandleOnCellClick;
            map.OnCellEnter += HandleOnCellEnter;

            // Focus on Berlin
            City city = map.GetCity("Berlin", "Germany");

            map.FlyToCity(city, 1f, 0.1f);

            // Creates a tank and positions it on the center of the hexagonal cell which contains Berlin
            Cell startCell = map.GetCell(city.unity2DLocation);

            DropTankOnPosition(startCell.center);
            startCellIndex = map.GetCellIndex(startCell);

            // Paint some country costs
            PaintCountries();
        }
Пример #2
0
 void FlyToCity(string cityName, string countryName)
 {
     map.FlyToCity(cityName, countryName, 2.0f, 0.05f);
 }
Пример #3
0
 public void FlyToMadrid()
 {
     map.FlyToCity("Madrid", "Spain", 2.0f, 0.05f);
 }