forked from wmvanvliet/Kerbulator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
UnityGlue.cs
71 lines (55 loc) · 1.61 KB
/
UnityGlue.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System.Collections.Generic;
using System.Collections;
using UnityEngine;
namespace Kerbulator {
/// <summary>Glue code when plugin is loaded in the Unity editor and KSP game
/// assembly is not available.</summary>
public class UnityGlue : MonoBehaviour, IGlue {
private KerbulatorGUI gui = null;
private KerbulatorOptions options = null;
/// <summary>Called by Unity when the Plugin is started</summary>
void Awake() {
options = new KerbulatorOptions();
gui = new KerbulatorGUI(this, true, true, options);
}
/// <summary>Called by Unity to draw the GUI</summary>
public void OnGUI() {
gui.OnGUI();
}
public void OnApplicationFocus(bool focused) {
if(gui != null)
gui.OnApplicationFocus(focused);
}
public void AddGlobals(Kerbulator kalc) {
}
public void PlaceNodes(List<string> ids, List<object> maneuverNode, List<System.Object> output) {
}
public Texture2D GetTexture(string id) {
return (Texture2D)Resources.Load(id);
}
public void ChangeState(bool open) {
}
public void RunAsCoroutine(IEnumerator f) {
StartCoroutine(f);
}
public void OnDestroy() {
if(gui != null)
gui.OnDestroy();
}
public void AddAlarms(string name, List<string> ids, List<System.Object> alarms, List<System.Object> output) {
}
public bool CanAddAlarm() {
return true;
}
public bool CanAddNode() {
return true;
}
public string GetFunctionDir() {
return "/Users/rodin/Projects/Kerbulator/KerbulatorFunctions";
}
public void PreventClickthrough(Rect r, string lockName) {
}
public void EnsureLockReleased(string lockName) {
}
}
}