private IEnumerator Attach(GameObject target, Transform parent, InteractionSource source)
    {
        yield return(ControllerHelpers.AttachModel(target, parent, source, GLTFMaterial, GLTFMaterial));

        if (AnimateControllerModel)
        {
            var newControllerInfo = new MotionControllerInfo()
            {
            };
            newControllerInfo.LoadInfo(target.GetComponentsInChildren <Transform>(), this);
            controllerInfoForAnimation.Add(source.id, newControllerInfo);
            TraceHelper.Log("Controller added for animation");
        }

        if (ShowDebugAxis)
        {
            if (source.handedness == InteractionSourceHandedness.Left)
            {
                axisRendererLeft = target.AddComponent <AxisRenderer>();
            }
            else
            {
                axisRendererRight = target.AddComponent <AxisRenderer>();
            }
        }
    }
        private IEnumerator Attach(GameObject target, Transform parent, InteractionSource source)
        {
            yield return(ControllerHelpers.AttachModel(target, parent, source, GLTFMaterial, GLTFMaterial));

            inProgressSources.Remove(source.id);
            FinishControllerSetup(target, source.handedness.ToString(), source.id);

            if (ShowDebugAxis)
            {
                TraceHelper.LogOnUnityThread("Attaching Debug Axis to " + source.handedness);
                if (source.handedness == InteractionSourceHandedness.Left)
                {
                    axisRendererLeft = target.AddComponent <AxisRenderer>();
                }
                else
                {
                    axisRendererRight = target.AddComponent <AxisRenderer>();
                }
            }

#if SKIPNPUTMODULE
            WinMRSnippets.Samples.Input.MotionControllerInputModule.Instance.AddController(source.id);
            WinMRSnippets.Samples.Input.MotionControllerInputModule.Instance.AddController(source.id);
#endif
        }
Пример #3
0
    private IEnumerator Attach(GameObject target, Transform parent, XRNode nodeType)
    {
        yield return(ControllerHelpers.AttachModel(target, parent, nodeType, GLTFMaterial, GLTFMaterial));

        if (ShowDebugAxis)
        {
            if (nodeType == XRNode.LeftHand)
            {
                axisRendererLeft = target.AddComponent <AxisRenderer>();
            }
            else
            {
                axisRendererRight = target.AddComponent <AxisRenderer>();
            }
        }
    }