private void OnTriggerExit(Collider other) { var rayComponent = other.GetComponent <IRayInteract>(); if (rayComponent == null) { return; } if (_rayCube == rayComponent) { _rayCube = null; } }
private void OnTriggerEnter(Collider other) { var rayComponent = other.GetComponent <IRayInteract>(); if (rayComponent == null) { return; } if (_rayCube != null && _rayCube.FollowPlayer) { return; } _rayCube = rayComponent; }