Skip to content

Commit 16596be

Browse files
Merge pull request #2433 from SimonDarksideJ/MRTK-Version-Next_2018_2_upgradeplusfixes
Mrtk version next 2018 2 upgradeplusfixes
2 parents bb40bda + dccd93b commit 16596be

File tree

7 files changed

+115
-42
lines changed

7 files changed

+115
-42
lines changed

Assets/MixedRealityToolkit/_Core/Devices/MixedReality/WindowsMixedRealityController.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
using Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices;
55
using Microsoft.MixedReality.Toolkit.Internal.Definitions.Utilities;
66
using Microsoft.MixedReality.Toolkit.Internal.Interfaces.InputSystem;
7+
8+
#if UNITY_WSA
79
using Microsoft.MixedReality.Toolkit.Internal.Utilities;
810
using System;
911
using UnityEngine;
10-
11-
#if UNITY_WSA
1212
using UnityEngine.XR.WSA.Input;
1313
#endif
1414

Assets/MixedRealityToolkit/_Core/Devices/MixedReality/WindowsMixedRealityDeviceManager.cs

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
using Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices;
5-
using Microsoft.MixedReality.Toolkit.Internal.Definitions.Utilities;
64
using Microsoft.MixedReality.Toolkit.Internal.Interfaces;
7-
using System;
85
using System.Collections.Generic;
96
using System.Linq;
10-
using UnityEngine;
117

128
#if UNITY_WSA
9+
using Microsoft.MixedReality.Toolkit.Internal.Definitions.Devices;
10+
using Microsoft.MixedReality.Toolkit.Internal.Definitions.Utilities;
11+
using System;
1312
using UnityEngine.XR.WSA.Input;
14-
#endif
13+
using UnityEngine;
14+
#endif // UNITY_WSA
1515

1616
namespace Microsoft.MixedReality.Toolkit.Internal.Devices.WindowsMixedReality
1717
{
@@ -29,6 +29,12 @@ public WindowsMixedRealityDeviceManager(string name, uint priority) : base(name,
2929
/// </summary>
3030
private readonly Dictionary<uint, IMixedRealityController> activeControllers = new Dictionary<uint, IMixedRealityController>();
3131

32+
/// <inheritdoc/>
33+
public override IMixedRealityController[] GetActiveControllers()
34+
{
35+
return activeControllers.Values.ToArray();
36+
}
37+
3238
#if UNITY_WSA
3339

3440
#region IMixedRealityDeviceManager Interface
@@ -67,12 +73,6 @@ public override void Disable()
6773
}
6874
}
6975

70-
/// <inheritdoc/>
71-
public override IMixedRealityController[] GetActiveControllers()
72-
{
73-
return activeControllers.Values.ToArray();
74-
}
75-
7676
#endregion IMixedRealityDeviceManager Interface
7777

7878
#region Controller Utilities
@@ -187,5 +187,6 @@ private void InteractionManager_InteractionSourceLost(InteractionSourceLostEvent
187187
#endregion Unity InteractionManager Events
188188

189189
#endif // UNITY_WSA
190+
190191
}
191-
}
192+
}

Assets/MixedRealityToolkit/_Core/Managers/MixedRealityManager.cs

+59-24
Original file line numberDiff line numberDiff line change
@@ -167,30 +167,12 @@ private void Initialize()
167167
#endregion Managers Registration
168168

169169
#region SDK Initialization
170-
switch (Application.platform)
171-
{
172-
case RuntimePlatform.WindowsPlayer:
173-
case RuntimePlatform.WindowsEditor:
174-
AddManager(typeof(IMixedRealityDeviceManager), new OpenVRDeviceManager("OpenVR Device Manager", 10));
175-
break;
176-
case RuntimePlatform.OSXPlayer:
177-
case RuntimePlatform.OSXEditor:
178-
case RuntimePlatform.IPhonePlayer:
179-
break;
180-
case RuntimePlatform.Android:
181-
break;
182-
case RuntimePlatform.WebGLPlayer:
183-
break;
184-
case RuntimePlatform.WSAPlayerX86:
185-
case RuntimePlatform.WSAPlayerX64:
186-
case RuntimePlatform.WSAPlayerARM:
187-
AddManager(typeof(IMixedRealityDeviceManager), new WindowsMixedRealityDeviceManager("Mixed Reality Device Manager", 10));
188-
break;
189-
case RuntimePlatform.TizenPlayer:
190-
break;
191-
default:
192-
break;
193-
}
170+
171+
#if UNITY_EDITOR
172+
AddManagersForTheCurrentPlatformEditor();
173+
#else
174+
AddManagersForTheCurrentPlatform();
175+
#endif
194176

195177
#endregion SDK Initialization
196178

@@ -913,5 +895,58 @@ private void GetComponentByTypeAndName(Type type, string managerName, out IMixed
913895
#endregion Manager Utilities
914896

915897
#endregion Manager Container Management
898+
899+
#region Platform Selectors
900+
901+
private void AddManagersForTheCurrentPlatform()
902+
{
903+
switch (Application.platform)
904+
{
905+
case RuntimePlatform.WindowsPlayer:
906+
case RuntimePlatform.WindowsEditor:
907+
AddManager(typeof(IMixedRealityDeviceManager), new OpenVRDeviceManager("OpenVR Device Manager", 10));
908+
break;
909+
case RuntimePlatform.OSXPlayer:
910+
case RuntimePlatform.OSXEditor:
911+
case RuntimePlatform.IPhonePlayer:
912+
break;
913+
case RuntimePlatform.Android:
914+
break;
915+
case RuntimePlatform.WebGLPlayer:
916+
break;
917+
case RuntimePlatform.WSAPlayerX86:
918+
case RuntimePlatform.WSAPlayerX64:
919+
case RuntimePlatform.WSAPlayerARM:
920+
AddManager(typeof(IMixedRealityDeviceManager), new WindowsMixedRealityDeviceManager("Mixed Reality Device Manager", 10));
921+
break;
922+
default:
923+
break;
924+
}
925+
}
926+
927+
private void AddManagersForTheCurrentPlatformEditor()
928+
{
929+
switch (UnityEditor.EditorUserBuildSettings.activeBuildTarget)
930+
{
931+
case UnityEditor.BuildTarget.StandaloneWindows:
932+
case UnityEditor.BuildTarget.StandaloneWindows64:
933+
AddManager(typeof(IMixedRealityDeviceManager), new OpenVRDeviceManager("OpenVR Device Manager", 10));
934+
break;
935+
case UnityEditor.BuildTarget.StandaloneOSX:
936+
case UnityEditor.BuildTarget.iOS:
937+
break;
938+
case UnityEditor.BuildTarget.Android:
939+
break;
940+
case UnityEditor.BuildTarget.WebGL:
941+
break;
942+
case UnityEditor.BuildTarget.WSAPlayer:
943+
AddManager(typeof(IMixedRealityDeviceManager), new WindowsMixedRealityDeviceManager("Mixed Reality Device Manager", 10));
944+
break;
945+
default:
946+
break;
947+
}
948+
}
949+
950+
#endregion Platform Selectors
916951
}
917952
}

Assets/MixedRealityToolkit/_Core/Utilities/MotionController/MotionControllerVisualizer.cs

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace Microsoft.MixedReality.Toolkit.Internal.Utilities
3131
/// </summary>
3232
public class MotionControllerVisualizer : MonoBehaviour
3333
{
34+
#if UNITY_WSA
3435
[SerializeField]
3536
[Tooltip("This setting will be used to determine if the model, override or otherwise, should attempt to be animated based on the user's input.")]
3637
private bool animateControllerModel = true;
@@ -42,6 +43,7 @@ public class MotionControllerVisualizer : MonoBehaviour
4243
[SerializeField]
4344
[Tooltip("This setting will be used to determine if the model should always be the right alternate. If false, the platform controller models will be preferred, only if they can't be loaded will the alternate be used. Otherwise, it will always use the alternate model.")]
4445
private bool alwaysUseAlternateRightModel = false;
46+
#endif
4547

4648
[SerializeField]
4749
[Tooltip("Use a model with the tip in the positive Z direction and the front face in the positive Y direction. To override the platform left controller model set AlwaysUseAlternateModel to true; otherwise this will be the default if the model can't be found.")]

Packages/manifest.json

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
11
{
2-
"dependencies": {
3-
}
2+
"dependencies": {
3+
"com.unity.ads": "2.0.8",
4+
"com.unity.analytics": "2.0.16",
5+
"com.unity.package-manager-ui": "1.9.11",
6+
"com.unity.purchasing": "2.0.3",
7+
"com.unity.textmeshpro": "1.2.4",
8+
"com.unity.modules.ai": "1.0.0",
9+
"com.unity.modules.animation": "1.0.0",
10+
"com.unity.modules.assetbundle": "1.0.0",
11+
"com.unity.modules.audio": "1.0.0",
12+
"com.unity.modules.cloth": "1.0.0",
13+
"com.unity.modules.director": "1.0.0",
14+
"com.unity.modules.imageconversion": "1.0.0",
15+
"com.unity.modules.imgui": "1.0.0",
16+
"com.unity.modules.jsonserialize": "1.0.0",
17+
"com.unity.modules.particlesystem": "1.0.0",
18+
"com.unity.modules.physics": "1.0.0",
19+
"com.unity.modules.physics2d": "1.0.0",
20+
"com.unity.modules.screencapture": "1.0.0",
21+
"com.unity.modules.terrain": "1.0.0",
22+
"com.unity.modules.terrainphysics": "1.0.0",
23+
"com.unity.modules.tilemap": "1.0.0",
24+
"com.unity.modules.ui": "1.0.0",
25+
"com.unity.modules.uielements": "1.0.0",
26+
"com.unity.modules.umbra": "1.0.0",
27+
"com.unity.modules.unityanalytics": "1.0.0",
28+
"com.unity.modules.unitywebrequest": "1.0.0",
29+
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
30+
"com.unity.modules.unitywebrequestaudio": "1.0.0",
31+
"com.unity.modules.unitywebrequesttexture": "1.0.0",
32+
"com.unity.modules.unitywebrequestwww": "1.0.0",
33+
"com.unity.modules.vehicles": "1.0.0",
34+
"com.unity.modules.video": "1.0.0",
35+
"com.unity.modules.vr": "1.0.0",
36+
"com.unity.modules.wind": "1.0.0",
37+
"com.unity.modules.xr": "1.0.0"
38+
}
439
}

ProjectSettings/EditorBuildSettings.asset

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
EditorBuildSettings:
55
m_ObjectHideFlags: 0
66
serializedVersion: 2
7-
m_Scenes: []
7+
m_Scenes: []

ProjectSettings/ProjectVersion.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
m_EditorVersion: 2018.1.7f1
1+
m_EditorVersion: 2018.2.0f2

0 commit comments

Comments
 (0)