Пример #1
0
        void OnTriggerExit(Collider other)
        {
            if (other.gameObject.name.Contains("Panel") || other.gameObject.name.Contains("Tab"))
            {
                return;
            }

            interactive = null;
        }
Пример #2
0
        private void DeselectLastInteractiveItem()
        {
            if (lastInteraciveItem == null)
            {
                return;
            }

            lastInteraciveItem.CursorOut();
            lastInteraciveItem = null;
        }
Пример #3
0
        void OnTriggerEnter(Collider other)
        {
            var newInteractive = other.GetComponent <UIInteractive>();

            if (newInteractive == null || other.gameObject.name.Contains("Panel") || other.gameObject.name.Contains("Tab"))
            {
                return;
            }

            interactive = newInteractive;
            interactive.Click();
        }
Пример #4
0
        private void UpdateInteractiveItemsInformation()
        {
            if (lastInteraciveItem == currentInteractiveItem)
            {
                return;
            }

            currentInteractiveItem.CursorIn();
            DeselectLastInteractiveItem();

            lastInteraciveItem = currentInteractiveItem;
        }
Пример #5
0
        private bool RaycastForCurrentInteractiveItem()
        {
            var ray = new Ray(sourceTransform.position, sourceTransform.forward);

            if (!Physics.Raycast(ray, out hit, rayLength))
            {
                currentInteractiveItem = null;
                return(false);
            }

            currentInteractiveItem = hit.collider.GetComponent <UIInteractive>();
            return(currentInteractiveItem != null);
        }