Updating support for non-UWP build types

This commit is contained in:
Kurtis Eveleigh 2018-05-03 16:20:30 -07:00
Родитель 9693acc4af
Коммит 75c7b35876
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -85,6 +85,7 @@ namespace HoloToolkit.Unity.ControllerExamples
} }
} }
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
if (ControllerInfo != null) if (ControllerInfo != null)
{ {
for (int i = 0; i < brushCollection.Objects.Count; i++) for (int i = 0; i < brushCollection.Objects.Count; i++)
@ -179,6 +180,7 @@ namespace HoloToolkit.Unity.ControllerExamples
} }
} }
} }
#endif
} }
protected override void OnDestroy() protected override void OnDestroy()
@ -230,6 +232,7 @@ namespace HoloToolkit.Unity.ControllerExamples
protected override void OnAttachToController() protected override void OnAttachToController()
{ {
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
// Turn off the default controller's renderers // Turn off the default controller's renderers
ControllerInfo.SetRenderersVisible(false); ControllerInfo.SetRenderersVisible(false);
@ -243,7 +246,6 @@ namespace HoloToolkit.Unity.ControllerExamples
touchpadRenderer.enabled = true; touchpadRenderer.enabled = true;
} }
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
// Subscribe to input now that we're parented under the controller // Subscribe to input now that we're parented under the controller
InteractionManager.InteractionSourceUpdated += InteractionSourceUpdated; InteractionManager.InteractionSourceUpdated += InteractionSourceUpdated;
#endif #endif
@ -251,6 +253,7 @@ namespace HoloToolkit.Unity.ControllerExamples
protected override void OnDetachFromController() protected override void OnDetachFromController()
{ {
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
ControllerInfo.SetRenderersVisible(true); ControllerInfo.SetRenderersVisible(true);
// Get the touchpad and reassign the original material to it // Get the touchpad and reassign the original material to it
@ -261,7 +264,6 @@ namespace HoloToolkit.Unity.ControllerExamples
touchpadRenderer.material = originalTouchpadMaterial; touchpadRenderer.material = originalTouchpadMaterial;
} }
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
// Unsubscribe from input // Unsubscribe from input
InteractionManager.InteractionSourceUpdated -= InteractionSourceUpdated; InteractionManager.InteractionSourceUpdated -= InteractionSourceUpdated;
#endif #endif

Просмотреть файл

@ -57,6 +57,7 @@ namespace HoloToolkit.Unity.ControllerExamples
private void Update() private void Update()
{ {
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
if (ControllerInfo == null) if (ControllerInfo == null)
{ {
return; return;
@ -110,6 +111,7 @@ namespace HoloToolkit.Unity.ControllerExamples
} }
// Set the selector's color and blend it with white to make it visible on top of the wheel // Set the selector's color and blend it with white to make it visible on top of the wheel
selectorRenderer.material.color = Color.Lerp(selectedColor, Color.white, 0.5f); selectorRenderer.material.color = Color.Lerp(selectedColor, Color.white, 0.5f);
#endif
} }
protected override void OnAttachToController() protected override void OnAttachToController()