コード例 #1
0
        public void OnPointerOut(Transform target)
        {
            if (_previousHit.collider == null)
            {
                return;
            }

            PointableObject pointableObject = _previousHit.collider.gameObject.GetComponent <PointableObject>();

            _currentColor = DefaultColor;

            if (pointableObject == null)
            {
                return;
            }

            try
            {
                pointableObject.OnPointerOut();
            }
            catch
            {
                Debug.LogError($"On pointer out error in {pointableObject.name}");
            }
        }
コード例 #2
0
        private bool GetPointable()
        {
            if (hit.collider == null)
            {
                return(false);
            }

            PointableObject pointableObject = hit.collider.gameObject.GetComponent <PointableObject>();

            return(pointableObject != null);
        }
コード例 #3
0
        public void OnPointerClick()
        {
            if (hit.collider == null)
            {
                return;
            }

            PointableObject pointableObject = hit.collider.gameObject.GetComponent <PointableObject>();

            if (pointableObject == null)
            {
                return;
            }

            try
            {
                pointableObject.OnPointerClick();
            }
            catch
            {
                Debug.LogError($"On pointer click error in {pointableObject.name}");
            }
        }
コード例 #4
0
        public void OnPointerIn(Transform target)
        {
            if (hit.collider == null)
            {
                return;
            }

            PointableObject pointableObject = hit.collider.gameObject.GetComponent <PointableObject>();

            if (pointableObject == null)
            {
                return;
            }

            try
            {
                _currentColor = HoverColor;
                pointableObject.OnPointerIn();
            }
            catch
            {
                Debug.LogError($"On pointer in error in {pointableObject.name}");
            }
        }