public static void LoadPaths() { ConfigNode config; try { config = ConfigNode.Load(KerbCamGlobals.AssemblyPath + "/kerbcam-paths.cfg"); } catch (NullReferenceException) { Debug.LogWarning("KerbCam encountered NRE while loading kerbcam-paths.cfg - file corrupted?"); return; } if (config == null) { Debug.LogWarning( "KerbCam could not load paths. This is okay if " + "they have not been saved yet."); return; } var newPaths = new List <SimpleCamPath>(); foreach (var pathNode in config.GetNodes("PATH")) { var path = new SimpleCamPath(); path.Load(pathNode); newPaths.Add(path); } paths = newPaths; SelectedPath = null; }
public static SimpleCamPath NewPath() { numCreatedPaths++; var newPath = new SimpleCamPath("Path #" + numCreatedPaths); paths.Add(newPath); return(newPath); }
public static void Stop() { camControl.StopControlling(); if (SelectedPath != null) { SelectedPath.StopDrawing(); SelectedPath = null; } MainWindow.Instance.HideWindow(); }
public static void RemovePathAt(int index) { var path = paths[index]; if (path == selectedPath) { SelectedPath = null; } paths.RemoveAt(index); path.Destroy(); }
internal static PathRunner Create(SimpleCamPath path) { GameObject ownerObject = new GameObject("KerbCam.PathRunner"); UnityEngine.Object.DontDestroyOnLoad(ownerObject); PathRunner runner = ownerObject.AddComponent<PathRunner>(); runner.path = path; runner.ownerObject = ownerObject; // Don't use GUI layout, just input events and frame updates. runner.useGUILayout = false; runner.enabled = false; return runner; }
public static void Stop() { if (!initialized) { return; } camControl.StopControlling(); if (SelectedPath != null) { SelectedPath.StopDrawing(); SelectedPath = null; } mainWindow.HideWindow(); }
public static SimpleCamPath NewPath() { numCreatedPaths++; var newPath = new SimpleCamPath("Path #" + numCreatedPaths); paths.Add(newPath); return newPath; }
public static void LoadPaths() { ConfigNode config; config = ConfigNode.Load("kerbcam-paths.cfg"); if (config == null) { Debug.LogWarning( "KerbCam could not load paths. This is okay if " + "they have not been saved yet."); return; } var newPaths = new List<SimpleCamPath>(); foreach (var pathNode in config.GetNodes("PATH")) { var path = new SimpleCamPath(); path.Load(pathNode); newPaths.Add(path); } paths = newPaths; SelectedPath = null; }
public static void LoadPaths() { ConfigNode config; try { config = ConfigNode.Load("kerbcam-paths.cfg"); } catch (NullReferenceException) { Debug.LogWarning("KerbCam encountered NRE while loading kerbcam-paths.cfg - file corrupted?"); return; } if (config == null) { Debug.LogWarning( "KerbCam could not load paths. This is okay if " + "they have not been saved yet."); return; } var newPaths = new List<SimpleCamPath>(); foreach (var pathNode in config.GetNodes("PATH")) { var path = new SimpleCamPath(); path.Load(pathNode); newPaths.Add(path); } paths = newPaths; SelectedPath = null; }