-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.cs
59 lines (50 loc) · 1.45 KB
/
test.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
namespace CareerManager
{
[KSPAddon(KSPAddon.Startup.MainMenu, true)]
public class CareerManager : MonoBehaviourExtended
{
public MissionList missionInstance;
public AddMissionWindow addmissionInstance;
public void Start()
{
missionInstance = new MissionList();
missionInstance.Start();
addmissionInstance = new AddMissionWindow();
addmissionInstance.Start();
missionInstance.exList.add(addmissionInstance); // give the base class knowledge of the extended class. I've used a list since it sounds like something I'd use more than one of
}
public void OnGUI()
{
missionInstance.OnGUI();
addmissionInstance.OnGUI();
}
}
namespace MissionList
{
public class MissionList : MonoBehaviourExtended
{
public bool drawaddmission = false;
void OnGUI()
{
/// gui code that wraps the button
if (GUILayout.Button("Add Mission"))
{
drawaddmission = true;
}
}
}
public class AddMissionWindow : MissionList
{
if (MissionList.drawaddmission)
void OnGUI()
{
if (MissionList.drawaddmission)
{
///gui with a string input and wraps a button
if (GUILayout.Button("Add Mission"))
{
MissionList.drawaddmission = false;
}
}
}
}