Updating scripts to work with the latest Toolkit

This commit is contained in:
Kurtis Eveleigh 2018-05-01 09:59:15 -07:00
Родитель 0670150fb4
Коммит d8a92d99e8
4 изменённых файлов: 13 добавлений и 13 удалений

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

@ -85,7 +85,7 @@ namespace HoloToolkit.Unity.ControllerExamples
}
}
if (controller != null)
if (ControllerInfo != null)
{
for (int i = 0; i < brushCollection.Objects.Count; i++)
{
@ -191,7 +191,7 @@ namespace HoloToolkit.Unity.ControllerExamples
#if UNITY_WSA && UNITY_2017_2_OR_NEWER
private void InteractionSourceUpdated(InteractionSourceUpdatedEventArgs obj)
{
if (obj.state.source.handedness == handedness)
if (obj.state.source.handedness == Handedness)
{
if (obj.state.touchpadPressed)
{
@ -231,11 +231,11 @@ namespace HoloToolkit.Unity.ControllerExamples
protected override void OnAttachToController()
{
// Turn off the default controller's renderers
controller.SetRenderersVisible(false);
ControllerInfo.SetRenderersVisible(false);
// Get the touchpad and assign our custom material to it
Transform touchpad;
if (controller.TryGetElement(MotionControllerInfo.ControllerElementEnum.Touchpad, out touchpad))
if (ControllerInfo.TryGetElement(MotionControllerInfo.ControllerElementEnum.Touchpad, out touchpad))
{
touchpadRenderer = touchpad.GetComponentInChildren<MeshRenderer>();
originalTouchpadMaterial = touchpadRenderer.material;
@ -251,11 +251,11 @@ namespace HoloToolkit.Unity.ControllerExamples
protected override void OnDetachFromController()
{
controller.SetRenderersVisible(true);
ControllerInfo.SetRenderersVisible(true);
// Get the touchpad and reassign the original material to it
Transform touchpad;
if (controller.TryGetElement(MotionControllerInfo.ControllerElementEnum.Touchpad, out touchpad))
if (ControllerInfo.TryGetElement(MotionControllerInfo.ControllerElementEnum.Touchpad, out touchpad))
{
touchpadRenderer = touchpad.GetComponentInChildren<MeshRenderer>();
touchpadRenderer.material = originalTouchpadMaterial;

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

@ -57,7 +57,7 @@ namespace HoloToolkit.Unity.ControllerExamples
private void Update()
{
if (controller == null)
if (ControllerInfo == null)
{
return;
}
@ -149,7 +149,7 @@ namespace HoloToolkit.Unity.ControllerExamples
private void InteractionSourceUpdated(InteractionSourceUpdatedEventArgs obj)
{
// Check if it is a touchpadTouched event and from the left controller
if (obj.state.source.handedness == handedness && obj.state.touchpadTouched)
if (obj.state.source.handedness == Handedness && obj.state.touchpadTouched)
{
// If both are true, Visible is set to true and the touchpad position is assigned to selectorPosition.
Visible = true;

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

@ -167,7 +167,7 @@ namespace HoloToolkit.Unity.ControllerExamples
private void InteractionSourcePressed(InteractionSourcePressedEventArgs obj)
{
// Check handedness, see if it is left controller
if (obj.state.source.handedness == handedness)
if (obj.state.source.handedness == Handedness)
{
switch (obj.pressType)
{
@ -200,7 +200,7 @@ namespace HoloToolkit.Unity.ControllerExamples
private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
{
if (obj.state.source.handedness == handedness)
if (obj.state.source.handedness == Handedness)
{
switch (obj.pressType)
{

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

@ -61,7 +61,7 @@ namespace HoloToolkit.Unity.Controllers
/// <param name="obj"></param>
private void InteractionSourcePressed(InteractionSourcePressedEventArgs obj)
{
if (obj.state.source.handedness == handedness && obj.pressType == activePressType)
if (obj.state.source.handedness == Handedness && obj.pressType == activePressType)
{
pointer.Active = true;
}
@ -73,7 +73,7 @@ namespace HoloToolkit.Unity.Controllers
/// <param name="obj"></param>
private void InteractionSourceUpdated(InteractionSourceUpdatedEventArgs obj)
{
if (obj.state.source.handedness == handedness && obj.state.thumbstickPressed)
if (obj.state.source.handedness == Handedness && obj.state.thumbstickPressed)
{
float angle = 0f;
Vector2 thumbstickPosition = obj.state.thumbstickPosition;
@ -91,7 +91,7 @@ namespace HoloToolkit.Unity.Controllers
/// <param name="obj"></param>
private void InteractionSourceReleased(InteractionSourceReleasedEventArgs obj)
{
if (obj.state.source.handedness == handedness && obj.pressType == activePressType)
if (obj.state.source.handedness == Handedness && obj.pressType == activePressType)
{
pointer.Active = false;
}