コード例 #1
0
        private void OnTriggerExit(Collider other)
        {
            var rayComponent = other.GetComponent <IRayInteract>();

            if (rayComponent == null)
            {
                return;
            }
            if (_rayCube == rayComponent)
            {
                _rayCube = null;
            }
        }
コード例 #2
0
        private void OnTriggerEnter(Collider other)
        {
            var rayComponent = other.GetComponent <IRayInteract>();

            if (rayComponent == null)
            {
                return;
            }
            if (_rayCube != null && _rayCube.FollowPlayer)
            {
                return;
            }
            _rayCube = rayComponent;
        }