@@ -37,10 +37,12 @@ public static string APP_BUTTON_LOGO_ALT {
37
37
38
38
#region Private Members
39
39
protected ApplicationLauncherButton appMainButton = null ;
40
+ #if DEBUG
40
41
protected ApplicationLauncherButton appDebugButton = null ;
42
+ #endif
41
43
protected static GameObject uiMainCanvas = null ;
42
44
protected static GameObject uiDebugCanvas = null ;
43
- #endregion
45
+ #endregion
44
46
45
47
protected void Awake ( ) {
46
48
// when ready for a GUI, load it
@@ -68,19 +70,17 @@ public void OnAppLauncherReady() {
68
70
GameDatabase . Instance . GetTexture ( APP_BUTTON_LOGO , false ) ) ;
69
71
}
70
72
73
+ #if DEBUG
71
74
// create a debugging tools app button instance if it doesn't already exist
72
75
if ( appDebugButton == null ) {
73
76
appDebugButton = ApplicationLauncher . Instance . AddModApplication (
74
77
OnDebugToggleTrue ,
75
78
OnDebugToggleFalse ,
76
79
null , null , null , null ,
77
- #if DEBUG
78
80
ApplicationLauncher . AppScenes . ALWAYS ,
79
- #else
80
- ApplicationLauncher . AppScenes . NEVER ,
81
- #endif
82
- GameDatabase. Instance . GetTexture ( APP_BUTTON_LOGO_ALT , false ) ) ;
81
+ GameDatabase . Instance . GetTexture ( APP_BUTTON_LOGO_ALT , false ) ) ;
83
82
}
83
+ #endif
84
84
85
85
// load the UI prefab
86
86
if ( uiMainCanvas == null ) {
@@ -111,10 +111,12 @@ public void OnAppLauncherDestroyed() {
111
111
appMainButton . SetFalse ( true ) ;
112
112
ApplicationLauncher . Instance . RemoveApplication ( appMainButton ) ;
113
113
}
114
+ #if DEBUG
114
115
if ( appDebugButton != null ) {
115
116
appDebugButton . SetFalse ( true ) ;
116
117
ApplicationLauncher . Instance . RemoveApplication ( appDebugButton ) ;
117
118
}
119
+ #endif
118
120
}
119
121
120
122
/// <summary>
@@ -125,17 +127,18 @@ public void OnMainToggleTrue() {
125
127
}
126
128
127
129
/// <summary>
128
- /// Callback when the debug application button is toggled on .
130
+ /// Callback when the main application button is toggled off .
129
131
/// </summary>
130
- public void OnDebugToggleTrue ( ) {
131
- uiDebugCanvas . SetActive ( true ) ;
132
+ public void OnMainToggleFalse ( ) {
133
+ uiMainCanvas . SetActive ( false ) ;
132
134
}
133
135
136
+ #if DEBUG
134
137
/// <summary>
135
- /// Callback when the main application button is toggled off .
138
+ /// Callback when the debug application button is toggled on .
136
139
/// </summary>
137
- public void OnMainToggleFalse ( ) {
138
- uiMainCanvas . SetActive ( false ) ;
140
+ public void OnDebugToggleTrue ( ) {
141
+ uiDebugCanvas . SetActive ( true ) ;
139
142
}
140
143
141
144
/// <summary>
@@ -144,14 +147,17 @@ public void OnMainToggleFalse() {
144
147
public void OnDebugToggleFalse ( ) {
145
148
uiDebugCanvas . SetActive ( false ) ;
146
149
}
150
+ #endif
147
151
148
152
/// <summary>
149
153
/// Callback when the game changes scenes.
150
154
/// </summary>
151
155
protected void OnSceneChange ( GameEvents . FromToAction < GameScenes , GameScenes > fromToScenes ) {
152
156
// on scene change, command the button to toggle off, so the GUI closes
153
157
appMainButton . SetFalse ( true ) ;
158
+ #if DEBUG
154
159
appDebugButton . SetFalse ( true ) ;
160
+ #endif
155
161
}
156
162
}
157
163
@@ -310,9 +316,9 @@ void OnHmdStatusUpdated(bool isRunning) {
310
316
311
317
public class AppDebugGUI : AppGUI
312
318
{
313
- #region Private Members
319
+ #region Private Members
314
320
private Text debugText ;
315
- #endregion
321
+ #endregion
316
322
317
323
private void Awake ( ) {
318
324
// get text label objects
0 commit comments