Skip to content

Commit 45f8b9e

Browse files
Revert "Updated Capability window and Auto Configure window."
This reverts commit c374d34.
1 parent c374d34 commit 45f8b9e

File tree

3 files changed

+36
-51
lines changed

3 files changed

+36
-51
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private void SettingToggle(TSetting setting)
6161
/// </summary>
6262
protected virtual void Awake()
6363
{
64-
wrapStyle = new GUIStyle("label") { wordWrap = true };
64+
wrapStyle = new GUIStyle() { wordWrap = true };
6565
}
6666
protected virtual void OnEnable()
6767
{
@@ -112,7 +112,7 @@ protected virtual void OnGUI()
112112
/// <summary>
113113
/// Gets the descriptions of the settings.
114114
/// </summary>
115-
protected Dictionary<TSetting, string> Descriptions
115+
public Dictionary<TSetting, string> Descriptions
116116
{
117117
get
118118
{
@@ -128,7 +128,7 @@ protected Dictionary<TSetting, string> Descriptions
128128
/// <summary>
129129
/// Gets the names of the settings.
130130
/// </summary>
131-
protected Dictionary<TSetting, string> Names
131+
public Dictionary<TSetting, string> Names
132132
{
133133
get
134134
{
@@ -144,7 +144,7 @@ protected Dictionary<TSetting, string> Names
144144
/// <summary>
145145
/// Gets the values of the settings.
146146
/// </summary>
147-
protected Dictionary<TSetting, bool> Values
147+
public Dictionary<TSetting, bool> Values
148148
{
149149
get
150150
{
@@ -160,7 +160,7 @@ protected Dictionary<TSetting, bool> Values
160160
/// <summary>
161161
/// Gets or sets the status message displayed at the bottom of the window.
162162
/// </summary>
163-
private string StatusMessage { get { return statusMessage; } set { statusMessage = value; } }
163+
public string StatusMessage { get { return statusMessage; } set { statusMessage = value; } }
164164
#endregion // Public Properties
165165
}
166166
}

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace HoloToolkit.Unity
1212
public class CapabilitySettingsWindow : AutoConfigureWindow<PlayerSettings.WSACapability>
1313
{
1414
#region Internal Methods
15-
1615
private void ApplySetting(PlayerSettings.WSACapability setting)
1716
{
1817
PlayerSettings.WSA.SetCapability(setting, Values[setting]);
@@ -31,8 +30,6 @@ protected override void ApplySettings()
3130
ApplySetting(PlayerSettings.WSACapability.SpatialPerception);
3231
ApplySetting(PlayerSettings.WSACapability.WebCam);
3332
ApplySetting(PlayerSettings.WSACapability.InternetClient);
34-
ApplySetting(PlayerSettings.WSACapability.InternetClientServer);
35-
ApplySetting(PlayerSettings.WSACapability.PrivateNetworkClientServer);
3633
}
3734

3835
protected override void LoadSettings()
@@ -41,8 +38,6 @@ protected override void LoadSettings()
4138
LoadSetting(PlayerSettings.WSACapability.SpatialPerception);
4239
LoadSetting(PlayerSettings.WSACapability.WebCam);
4340
LoadSetting(PlayerSettings.WSACapability.InternetClient);
44-
LoadSetting(PlayerSettings.WSACapability.InternetClientServer);
45-
LoadSetting(PlayerSettings.WSACapability.PrivateNetworkClientServer);
4641
}
4742

4843
protected override void LoadStrings()
@@ -58,12 +53,6 @@ protected override void LoadStrings()
5853

5954
Names[PlayerSettings.WSACapability.InternetClient] = "Internet Client";
6055
Descriptions[PlayerSettings.WSACapability.InternetClient] = "Required if your application needs to access the Internet.\n\nRecommendation: Leave unchecked unless your application uses online services.";
61-
62-
Names[PlayerSettings.WSACapability.InternetClientServer] = "Internet Client Server";
63-
Descriptions[PlayerSettings.WSACapability.InternetClientServer] = "Required if your application uses the Sharing Services.";
64-
65-
Names[PlayerSettings.WSACapability.PrivateNetworkClientServer] = "Private Network Client Server";
66-
Descriptions[PlayerSettings.WSACapability.PrivateNetworkClientServer] = "Required if your application uses the Sharing Services.";
6756
}
6857

6958
protected override void OnEnable()
@@ -72,7 +61,7 @@ protected override void OnEnable()
7261
base.OnEnable();
7362

7463
// Set size
75-
minSize = new Vector2(350, 350);
64+
minSize = new Vector2(350, 255);
7665
maxSize = minSize;
7766
}
7867
#endregion // Overrides / Event Handlers

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

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ public enum ProjectSetting
2121
BuildWsaUwp,
2222
WsaUwpBuildToD3D,
2323
WsaFastestQuality,
24-
WsaEnableVR,
25-
SharingServices
24+
WsaEnableVR
2625
}
2726
#endregion // Nested Types
2827

2928
#region Internal Methods
3029
/// <summary>
3130
/// Enables virtual reality for WSA and ensures HoloLens is in the supported SDKs.
3231
/// </summary>
33-
private static void EnableVirtualReality()
32+
private void EnableVirtualReality()
3433
{
3534
try
3635
{
@@ -78,7 +77,7 @@ private static void EnableVirtualReality()
7877
}
7978
else
8079
{
81-
// The target VR settings were found but the others
80+
// The target VR settngs were found but the others
8281
// still need to be searched for.
8382
foundBuildTargetVRSettings = true;
8483
}
@@ -120,12 +119,12 @@ private static void EnableVirtualReality()
120119
// If this isn't an element in the device list
121120
if (!line.Contains("-"))
122121
{
123-
// add the HoloLens element, and mark it found
122+
// add the hololens element, and mark it found
124123
builder.Append(" - HoloLens\n");
125124
foundHoloLens = true;
126125
}
127126

128-
// Otherwise test if this is the HoloLens device
127+
// Otherwise test if this is the hololens device
129128
else if (line.Contains("HoloLens"))
130129
{
131130
foundHoloLens = true;
@@ -156,7 +155,7 @@ private static void EnableVirtualReality()
156155
/// <summary>
157156
/// Modifies the WSA default quality setting to the fastest
158157
/// </summary>
159-
private static void SetFastestDefaultQuality()
158+
private void SetFastestDefaultQuality()
160159
{
161160
try
162161
{
@@ -180,44 +179,46 @@ private static void SetFastestDefaultQuality()
180179
#region Overrides / Event Handlers
181180
protected override void ApplySettings()
182181
{
182+
// See the blow notes for why text asset serialization is required
183+
if (EditorSettings.serializationMode != SerializationMode.ForceText)
184+
{
185+
// NOTE: PlayerSettings.virtualRealitySupported would be ideal, except that it only reports/affects whatever platform tab
186+
// is currently selected in the Player settings window. As we don't have code control over what view is selected there
187+
// this property is fairly useless from script.
188+
189+
// NOTE: There is no current way to change the default quality setting from script
190+
191+
string dialogTitle = "Updates require text serialization of assets";
192+
string message = "Unity doesn't provide apis for updating the default quality or enabling VR support.\n\n" +
193+
"Is it ok if we force text serialization of assets so that we can modify the properties directly?";
194+
195+
bool forceText = EditorUtility.DisplayDialog(dialogTitle, message, "Yes", "No");
196+
if (!forceText)
197+
{
198+
return;
199+
}
200+
201+
EditorSettings.serializationMode = SerializationMode.ForceText;
202+
}
203+
183204
// Apply individual settings
184205
if (Values[ProjectSetting.BuildWsaUwp])
185206
{
186207
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.WSA, BuildTarget.WSAPlayer);
187208
}
188-
189209
if (Values[ProjectSetting.WsaUwpBuildToD3D])
190210
{
191211
EditorUserBuildSettings.wsaUWPBuildType = WSAUWPBuildType.D3D;
192212
}
193-
194213
if (Values[ProjectSetting.WsaFastestQuality])
195214
{
196215
SetFastestDefaultQuality();
197216
}
198-
199217
if (Values[ProjectSetting.WsaEnableVR])
200218
{
201219
EnableVirtualReality();
202220
}
203221

204-
if (Values[ProjectSetting.SharingServices])
205-
{
206-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.Microphone, true);
207-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClient, true);
208-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.SpatialPerception, true);
209-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClientServer, true);
210-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.PrivateNetworkClientServer, true);
211-
}
212-
else
213-
{
214-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.Microphone, false);
215-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClient, false);
216-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.SpatialPerception, false);
217-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.InternetClientServer, false);
218-
PlayerSettings.WSA.SetCapability(PlayerSettings.WSACapability.PrivateNetworkClientServer, false);
219-
}
220-
221222
// Since we went behind Unity's back to tweak some settings we
222223
// need to reload the project to have them take effect
223224
bool canReload = EditorUtility.DisplayDialog(
@@ -234,7 +235,7 @@ protected override void ApplySettings()
234235

235236
protected override void LoadSettings()
236237
{
237-
for (int i = (int)ProjectSetting.BuildWsaUwp; i <= (int)ProjectSetting.SharingServices; i++)
238+
for (int i = (int)ProjectSetting.BuildWsaUwp; i <= (int)ProjectSetting.WsaEnableVR; i++)
238239
{
239240
Values[(ProjectSetting)i] = true;
240241
}
@@ -253,11 +254,6 @@ protected override void LoadStrings()
253254

254255
Names[ProjectSetting.WsaEnableVR] = "Enable VR";
255256
Descriptions[ProjectSetting.WsaEnableVR] = "Required\n\nEnables VR for Windows Store apps and adds the HoloLens as a target VR device.\n\nThe application will not compile for HoloLens and tools like Holographic Remoting will not function without this enabled. Therefore this option should remain checked unless you plan to manually perform these steps later.";
256-
257-
Names[ProjectSetting.SharingServices] = "Enable Sharing Services";
258-
Descriptions[ProjectSetting.SharingServices] = "Enables the use of the Sharing Services in your project.\n\n" +
259-
"Requires the SpatialPerception, InternetClient, InternetClientServer, PrivateNetworkClientServer, and Microphone Capabilities.\n\n" +
260-
"Start the Sharing Server though HoloToolkit->Sharing Service->Launch Sharing Service.";
261257
}
262258

263259
protected override void OnEnable()
@@ -266,7 +262,7 @@ protected override void OnEnable()
266262
base.OnEnable();
267263

268264
// Set size
269-
minSize = new Vector2(350, 350);
265+
minSize = new Vector2(350, 260);
270266
maxSize = minSize;
271267
}
272268
#endregion // Overrides / Event Handlers

0 commit comments

Comments
 (0)