Skip to content

Commit ca0a5a1

Browse files
Removed build target switch and quality settings hack.
1 parent 2d376f3 commit ca0a5a1

File tree

8 files changed

+128
-216
lines changed

8 files changed

+128
-216
lines changed

Assets/HoloToolkit/BuildAndDeploy/Editor/BuildSLNUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static void PerformBuild(BuildInfo buildInfo)
9292
if (buildInfo.HasAnySymbols(BuildSymbolRelease))
9393
{
9494
//Unity automatically adds the DEBUG symbol if the BuildOptions.Development flag is
95-
//specified. In order to have debug symbols and the RELEASE symbole we have to
95+
//specified. In order to have debug symbols and the RELEASE symbols we have to
9696
//inject the symbol Unity relies on to enable the /debug+ flag of csc.exe which is "DEVELOPMENT_BUILD"
9797
buildInfo.AppendSymbols("DEVELOPMENT_BUILD");
9898
}

Assets/HoloToolkit/Utilities/Scripts/Editor/AutoConfigureMenu.cs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
using UnityEditor;
5+
using UnityEditor.Build;
56
using UnityEngine;
67

78
namespace HoloToolkit.Unity
@@ -10,8 +11,11 @@ namespace HoloToolkit.Unity
1011
/// Configuration options derived from here:
1112
/// https://developer.microsoft.com/en-us/windows/holographic/unity_development_overview#Configuring_a_Unity_project_for_HoloLens
1213
/// </summary>
13-
public class AutoConfigureMenu : MonoBehaviour
14+
public class AutoConfigureMenu : IActiveBuildTargetChanged
1415
{
16+
public delegate void BuildTargetArgs(BuildTarget newTarget);
17+
public static event BuildTargetArgs ActiveBuildTargetChanged;
18+
1519
/// <summary>
1620
/// Displays a help page for the HoloToolkit.
1721
/// </summary>
@@ -25,30 +29,40 @@ public static void ShowHelp()
2529
/// Applies recommended scene settings to the current scenes
2630
/// </summary>
2731
[MenuItem("HoloToolkit/Configure/Apply HoloLens Scene Settings", false, 1)]
28-
public static void ApplySceneSettings()
32+
public static void ShowSceneSettingsWindow()
2933
{
30-
SceneSettingsWindow window = (SceneSettingsWindow)EditorWindow.GetWindow(typeof(SceneSettingsWindow), true, "Apply HoloLens Scene Settings");
34+
var window = (SceneSettingsWindow)EditorWindow.GetWindow(typeof(SceneSettingsWindow), true, "Apply HoloLens Scene Settings");
3135
window.Show();
3236
}
3337

3438
/// <summary>
3539
/// Applies recommended project settings to the current project
3640
/// </summary>
3741
[MenuItem("HoloToolkit/Configure/Apply HoloLens Project Settings", false, 1)]
38-
public static void ApplyProjectSettings()
42+
public static void ShowProjectSettingsWindow()
3943
{
40-
ProjectSettingsWindow window = (ProjectSettingsWindow)EditorWindow.GetWindow(typeof(ProjectSettingsWindow), true, "Apply HoloLens Project Settings");
44+
var window = (ProjectSettingsWindow)EditorWindow.GetWindow(typeof(ProjectSettingsWindow), true, "Apply HoloLens Project Settings");
4145
window.Show();
4246
}
4347

4448
/// <summary>
4549
/// Applies recommended capability settings to the current project
4650
/// </summary>
4751
[MenuItem("HoloToolkit/Configure/Apply HoloLens Capability Settings", false, 2)]
48-
static void ApplyHoloLensCapabilitySettings()
52+
public static void ShowCapabilitySettingsWindow()
4953
{
50-
CapabilitySettingsWindow window = (CapabilitySettingsWindow)EditorWindow.GetWindow(typeof(CapabilitySettingsWindow), true, "Apply HoloLens Capability Settings");
54+
var window = (CapabilitySettingsWindow)EditorWindow.GetWindow(typeof(CapabilitySettingsWindow), true, "Apply HoloLens Capability Settings");
5155
window.Show();
5256
}
57+
58+
public int callbackOrder { get; private set; }
59+
60+
public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget newTarget)
61+
{
62+
if (ActiveBuildTargetChanged != null)
63+
{
64+
ActiveBuildTargetChanged.Invoke(newTarget);
65+
}
66+
}
5367
}
5468
}

Assets/HoloToolkit/Utilities/Scripts/Editor/AutoConfigureWindow.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,22 @@ namespace HoloToolkit.Unity
1414
public abstract class AutoConfigureWindow<TSetting> : EditorWindow
1515
{
1616
#region Member Variables
17+
1718
private Dictionary<TSetting, bool> values = new Dictionary<TSetting, bool>();
1819
private Dictionary<TSetting, string> names = new Dictionary<TSetting, string>();
1920
private Dictionary<TSetting, string> descriptions = new Dictionary<TSetting, string>();
2021

2122
private string statusMessage = string.Empty;
2223
private Vector2 scrollPosition = Vector2.zero;
2324
private GUIStyle wrapStyle;
25+
2426
#endregion // Member Variables
2527

2628
#region Internal Methods
2729
private void SettingToggle(TSetting setting)
2830
{
2931
EditorGUI.BeginChangeCheck();
32+
3033
// Draw and update setting flag
3134
values[setting] = GUILayout.Toggle(values[setting], new GUIContent(names[setting]));
3235

@@ -36,15 +39,17 @@ private void SettingToggle(TSetting setting)
3639
}
3740

3841
// If this control is the one under the mouse, update the status message
39-
if ((Event.current.type == EventType.Repaint) && (GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition)))
42+
if (Event.current.type == EventType.Repaint && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
4043
{
4144
StatusMessage = descriptions[setting];
4245
Repaint();
4346
}
4447
}
48+
4549
#endregion // Internal Methods
4650

4751
#region Overridables / Event Triggers
52+
4853
/// <summary>
4954
/// Called when settings should be applied.
5055
/// </summary>
@@ -68,13 +73,15 @@ private void SettingToggle(TSetting setting)
6873
#endregion // Overridables / Event Triggers
6974

7075
#region Overrides / Event Handlers
76+
7177
/// <summary>
7278
/// Called when the window is created.
7379
/// </summary>
7480
protected virtual void Awake()
7581
{
7682
wrapStyle = new GUIStyle("label") { wordWrap = true };
7783
}
84+
7885
protected virtual void OnEnable()
7986
{
8087
LoadStrings();
@@ -115,12 +122,13 @@ protected virtual void OnGUI()
115122
if (applyClicked)
116123
{
117124
ApplySettings();
118-
Close();
119125
}
120126
}
127+
121128
#endregion // Overrides / Event Handlers
122129

123130
#region Public Properties
131+
124132
/// <summary>
125133
/// Gets the descriptions of the settings.
126134
/// </summary>
@@ -173,6 +181,7 @@ protected Dictionary<TSetting, bool> Values
173181
/// Gets or sets the status message displayed at the bottom of the window.
174182
/// </summary>
175183
private string StatusMessage { get { return statusMessage; } set { statusMessage = value; } }
184+
176185
#endregion // Public Properties
177186
}
178187
}

Assets/HoloToolkit/Utilities/Scripts/Editor/CapabilitySettingsWindow.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,7 @@ private void LoadSetting(PlayerSettings.WSACapability setting)
7878

7979
protected override void ApplySettings()
8080
{
81-
ApplySetting(PlayerSettings.WSACapability.Microphone);
82-
ApplySetting(PlayerSettings.WSACapability.WebCam);
83-
ApplySetting(PlayerSettings.WSACapability.SpatialPerception);
84-
ApplySetting(PlayerSettings.WSACapability.InternetClient);
85-
ApplySetting(PlayerSettings.WSACapability.InternetClientServer);
86-
ApplySetting(PlayerSettings.WSACapability.PrivateNetworkClientServer);
81+
Close();
8782
}
8883

8984
protected override void LoadSettings()
@@ -98,7 +93,13 @@ protected override void LoadSettings()
9893

9994
protected override void OnGuiChanged()
10095
{
101-
ApplySettings();
96+
ApplySetting(PlayerSettings.WSACapability.Microphone);
97+
ApplySetting(PlayerSettings.WSACapability.WebCam);
98+
ApplySetting(PlayerSettings.WSACapability.SpatialPerception);
99+
ApplySetting(PlayerSettings.WSACapability.InternetClient);
100+
ApplySetting(PlayerSettings.WSACapability.InternetClientServer);
101+
ApplySetting(PlayerSettings.WSACapability.PrivateNetworkClientServer);
102+
102103
LoadSettings();
103104
}
104105

0 commit comments

Comments
 (0)