Пример #1
0
            protected static void CheckSensorComponent(HandTarget handTarget)
            {
                if (handTarget.hydra.sensorTransform == null)
                {
                    return;
                }

                HydraControllerComponent sensorComponent = handTarget.hydra.sensorTransform.GetComponent <HydraControllerComponent>();

                if (sensorComponent == null)
                {
                    sensorComponent = handTarget.hydra.sensorTransform.gameObject.AddComponent <HydraControllerComponent>();
                }
            }
Пример #2
0
        protected override void CreateSensorTransform()
        {
            if (handTarget.isLeft)
            {
                CreateSensorTransform("Hydra Controller", new Vector3(-0.01F, -0.04F, -0.01F), Quaternion.Euler(180, 110, 90));
            }
            else
            {
                CreateSensorTransform("Hydra Controller", new Vector3(0.01F, -0.04F, -0.01F), Quaternion.Euler(0, 70, 90));
            }

            HydraControllerComponent hydraController = sensorTransform.GetComponent <HydraControllerComponent>();

            if (hydraController == null)
            {
                hydraController = sensorTransform.gameObject.AddComponent <HydraControllerComponent>();
            }
            hydraController.isLeft = handTarget.isLeft;
        }
Пример #3
0
        public override void Start(HumanoidControl _humanoid, Transform targetTransform)
        {
            base.Start(_humanoid, targetTransform);
            tracker = handTarget.humanoid.hydra;

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

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

            if (sensorTransform != null)
            {
                hydraController = sensorTransform.GetComponent <HydraControllerComponent>();
                if (hydraController != null)
                {
                    hydraController.StartComponent(tracker.trackerTransform, handTarget.isLeft);
                }
            }
        }
Пример #4
0
 private void OnEnable()
 {
     hydraController = (HydraControllerComponent)target;
 }