// The globe can be moved and scaled at wish void ToggleMinimize() { minimizeState = !minimizeState; Camera.main.transform.rotation = Quaternion.Euler(Misc.Vector3zero); if (minimizeState) { map.earthStyle = EARTH_STYLE.Alternate2; //map.earthColor = Color.black; map.longitudeStepping = 4; map.latitudeStepping = 40; map.showCities = false; //MAX! map.showCountryNames = false; map.gridLinesColor = new Color(0.06f, 0.23f, 0.398f); map.fitWindowWidth = false; map.fitWindowHeight = false; map.frontiersThinLines = true; map.transform.position = Camera.main.transform.position + Vector3.forward * 500f + Vector3.right * 375.0f + Vector3.down * 225.0f; } else { map.frontiersThinLines = false; map.earthStyle = EARTH_STYLE.Natural; map.longitudeStepping = 15; map.latitudeStepping = 15; map.showCities = false; //MAX! map.showCountryNames = true; map.gridLinesColor = new Color(0.16f, 0.33f, 0.498f); map.CenterMap(); map.fitWindowWidth = true; map.fitWindowHeight = true; } }
void Start() { Screen.SetResolution(1920, 1080, true); currentEvent = -1; map = WorldMap2D.instance; data = GlobalTW.instance; //data.Init(); map.CenterMap(); // Center map on the screen FactionCount(); MapChoice(-1); EventList.Enqueue(1); if (data.countries.player == 0) { EventList.Enqueue(32); EventList.Enqueue(33); } else if (data.countries.player == 1) { EventList.Enqueue(34); EventList.Enqueue(35); } nextEvent(false); flag.sprite = eventImages[data.countries.player]; //WriteNewCountryList(); explain.enabled = false; ExplainText.enabled = false; ending = 0; }
// The globe can be moved and scaled at wish void ToggleMinimize() { minimizeState = !minimizeState; Camera.main.transform.position = Vector3.back * 1.1f; Camera.main.transform.rotation = Quaternion.Euler(Vector3.zero); if (minimizeState) { map.earthColor = Color.black; map.longitudeStepping = 4; map.latitudeStepping = 40; map.showCities = false; map.showCountryNames = false; map.gridLinesColor = new Color(0.06f, 0.23f, 0.398f); map.fitWindowWidth = false; map.fitWindowHeight = false; map.gameObject.transform.localScale = new Vector3(0.4f, 0.2f, 1); map.gameObject.transform.position = new Vector3(0.9f, -0.5f, 0); } else { map.gameObject.transform.localScale = new Vector3(200, 100, 0); map.CenterMap(); map.longitudeStepping = 15; map.latitudeStepping = 15; map.showCities = true; map.showCountryNames = true; map.gridLinesColor = new Color(0.16f, 0.33f, 0.498f); map.fitWindowWidth = true; map.fitWindowHeight = true; } }
void Start() { // Get a reference to the World Map API: map = WorldMap2D.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> ("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.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.OnCountryEnter += (int countryIndex, int regionIndex) => Debug.Log ("Entered country " + map.countries [countryIndex].name); * map.OnCountryExit += (int countryIndex, int regionIndex) => Debug.Log ("Exited country " + map.countries [countryIndex].name); * map.OnCountryClick += (int countryIndex, int regionIndex) => Debug.Log ("Clicked country " + map.countries [countryIndex].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.CenterMap(); }
void Start() { // Get a reference to the World Map API: map = WorldMap2D.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> ("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); map.CenterMap(); // Center map on the screen // map.ToggleCountrySurface("Brazil", true, Color.green); // map.ToggleCountrySurface(35, true, Color.green); // map.ToggleCountrySurface(33, true, Color.green); // map.FlyToCountry(33); // map.FlyToCountry("Brazil"); // map.navigationTime = 0; // map.FlyToCountry ("India"); }
public void CenterMap() { map.CenterMap(); CountryDetail.gameObject.SetActive(true); }
// Use this for initialization void Start() { map = WorldMap2D.instance; map.CenterMap(); }