static void Init() { Runnable.EnableRunnableInEditor(); //verify that the config file exists _configurationFile = Path.Combine(Constants.Path.MAPBOX_RESOURCES_ABSOLUTE, Constants.Path.GEOSERVER_CONFIG_FILE); if (!Directory.Exists(Constants.Path.MAPBOX_RESOURCES_ABSOLUTE)) { Directory.CreateDirectory(Constants.Path.MAPBOX_RESOURCES_ABSOLUTE); } if (!File.Exists(_configurationFile)) { _config = new GeoServerAccess.GeoServerConfiguration { Url = _geoServerUrl }; var json = JsonUtility.ToJson(_config); File.WriteAllText(_configurationFile, json); AssetDatabase.Refresh(); } //finish opening the window after the assetdatabase is refreshed. EditorApplication.delayCall += OpenWindow; }
private static void SubmitConfiguration() { var config = new GeoServerAccess.GeoServerConfiguration { Url = _geoServerUrl }; _geoServerAccess.SetConfiguration(config); }
static void OpenWindow() { EditorApplication.delayCall -= OpenWindow; _geoServerAccess = GeoServerAccess.Instance; //setup local variables from GeoServer config file _config = _geoServerAccess.Configuration; if (_config != null) { _geoServerUrl = _config.Url; } //instantiate the config window instance = GetWindow(typeof(GeoServerConfigurationWindow)) as GeoServerConfigurationWindow; instance.titleContent = new GUIContent("GeoServer Setup"); instance.Show(); }