Ejemplo n.º 1
0
        void OnTriggerEnter(Collider collider)
        {
            // vibrate controllers only if layer is "InteractiveObject"
            if (collider.gameObject.layer != 9)
            {
                return;
            }

            GrabbableHands grabbableHands = collider.GetComponent <GrabbableHands>();

            OVRInput.Controller currentController;

            // decide which controller to vibrate
            if (grabbableHands && grabbableHands.grabbedBy)
            {
                if (grabbableHands.grabbedBy.gameObject.name == "HandLeft")
                {
                    currentController = OVRInput.Controller.LTouch;
                }
                else
                {
                    currentController = OVRInput.Controller.RTouch;
                }
            }
            else
            {
                currentController = OVRInput.Controller.Touch;
            }

            TouchHaptics.Instance.VibrateFor(0.5f, 0.2f, 0.2f, currentController);
        }
Ejemplo n.º 2
0
        void Start()
        {
            grabbableHands = GetComponent <GrabbableHands>();

            sliderValue     = initialValue;
            prevSliderValue = initialValue;

            if (initialValue != 0)
            {
                float initialPos = (initialValue / movementRange) * (maxValue - minValue);
                setInitialPosition(initialPos);
            }

            audioSource = GetComponent <AudioSource>();
        }
Ejemplo n.º 3
0
        void Start()
        {
            conductorMF = GetComponent <ConductorMF>();

            isSnapped = false;
            toSnap    = false;

            grabbableHands = GetComponent <GrabbableHands>();
            rb             = GetComponent <Rigidbody>();

            // place at initial position if there's one referenced
            if (initialHook)
            {
                latestSnapStandHook = initialHook;
                toSnap = true;
            }

            audioSource = GetComponent <AudioSource>();
        }
Ejemplo n.º 4
0
 void Start()
 {
     grabbableHands = GetComponent <GrabbableHands>();
     placerSystem   = GameObject.FindWithTag("PlacerSystem").GetComponent <PlacerSystem>();
 }