// Update is called once per frame void OnGUI() { // Do autoresizing of GUI layer GUIResizer.AutoResize(); // Assorted options to show/hide frontiers, cities, Earth and enable country highlighting GUI.Box(new Rect(0, 0, 135, 200), ""); bool prev = enableClearFogOnClick; enableClearFogOnClick = GUI.Toggle(new Rect(10, 20, 150, 30), enableClearFogOnClick, "Toggle Clear Fog"); if (enableClearFogOnClick != prev && enableClearFogOnClick) { enableClearFogCountryOnClick = false; } prev = enableClearFogCountryOnClick; enableClearFogCountryOnClick = GUI.Toggle(new Rect(10, 50, 150, 30), enableClearFogCountryOnClick, "Toggle Country Fog"); if (enableClearFogCountryOnClick != prev && enableClearFogCountryOnClick) { enableClearFogOnClick = false; } // buttons background color GUI.backgroundColor = new Color(0.1f, 0.1f, 0.3f, 0.95f); // Add button to toggle Earth texture if (GUI.Button(new Rect(10, 90, 160, 30), " Reset Fog of War", buttonStyle)) { map.FogOfWarClear(true); } }