示例#1
0
        protected override void CreateSensorTransform()
        {
            if (handTarget.isLeft)
            {
                CreateSensorTransform("Windows MR Controller Left", new Vector3(-0.10F, -0.04F, 0.02F), Quaternion.Euler(0, -30, -90));
            }
            else
            {
                CreateSensorTransform("Windows MR Controller Right", new Vector3(0.10F, -0.04F, 0.02F), Quaternion.Euler(0, 30, 90));
            }

            WindowsMRControllerComponent mixedRealityController = sensorTransform.GetComponent <WindowsMRControllerComponent>();

            if (mixedRealityController == null)
            {
                mixedRealityController = sensorTransform.gameObject.AddComponent <WindowsMRControllerComponent>();
            }
            mixedRealityController.isLeft = handTarget.isLeft;
        }
示例#2
0
        public override void Start(HumanoidControl _humanoid, Transform targetTransform)
        {
            base.Start(_humanoid, targetTransform);
            tracker = handTarget.humanoid.mixedReality;

            if (tracker == null || !tracker.enabled || !enabled)
            {
                return;
            }

            SetSensor2Target();
            CheckSensorTransform();
            ShowSensor(handTarget.humanoid.showRealObjects && target.showRealObjects);

            if (sensorTransform != null)
            {
                mixedRealityController = sensorTransform.GetComponent <WindowsMRControllerComponent>();
                if (mixedRealityController != null)
                {
                    mixedRealityController.StartComponent(tracker.trackerTransform);
                }
            }
        }