Esempio n. 1
0
        private void OnTriggerStay(Collider collider)
        {
            NVRInteractable interactable = NVRInteractables.GetInteractable(collider);

            if (interactable == null || interactable.enabled == false)
            {
                return;
            }

            if (CurrentlyHoveringOver.ContainsKey(interactable) == false)
            {
                CurrentlyHoveringOver[interactable] = new Dictionary <Collider, float>();
            }

            if (CurrentlyHoveringOver[interactable].ContainsKey(collider) == false)
            {
                CurrentlyHoveringOver[interactable][collider] = Time.time;
            }
        }
Esempio n. 2
0
        protected virtual void OnTriggerStay(Collider collider)
        {
            NVRInteractable interactable = NVRInteractables.GetInteractable(collider);

            if (interactable == null || interactable.enabled == false || collider.tag.Equals("Ungrabbable"))
            {
                return;
            }

            if (CurrentlyHoveringOver.ContainsKey(interactable) == false)
            {
                CurrentlyHoveringOver[interactable] = new Dictionary <Collider, float>();
            }

            if (CurrentlyHoveringOver[interactable].ContainsKey(collider) == false)
            {
                CurrentlyHoveringOver[interactable][collider] = Time.time;
            }
        }
Esempio n. 3
0
        private void OnTriggerExit(Collider collider)
        {
            NVRInteractable interactable = NVRInteractables.GetInteractable(collider);

            if (interactable == null)
            {
                return;
            }

            if (CurrentlyHoveringOver.ContainsKey(interactable) == true)
            {
                if (CurrentlyHoveringOver[interactable].ContainsKey(collider) == true)
                {
                    CurrentlyHoveringOver[interactable].Remove(collider);
                    if (CurrentlyHoveringOver[interactable].Count == 0)
                    {
                        CurrentlyHoveringOver.Remove(interactable);
                    }
                }
            }
        }
Esempio n. 4
0
        protected virtual void OnTriggerExit(Collider collider)
        {
            NVRInteractable interactable = NVRInteractables.GetInteractable(collider);

            if (interactable == null || collider.tag.Equals("Ungrabbable"))
            {
                return;
            }

            if (CurrentlyHoveringOver.ContainsKey(interactable))
            {
                if (CurrentlyHoveringOver[interactable].ContainsKey(collider))
                {
                    CurrentlyHoveringOver[interactable].Remove(collider);
                    if (CurrentlyHoveringOver[interactable].Count == 0)
                    {
                        CurrentlyHoveringOver.Remove(interactable);
                    }
                }
            }
        }