void OnTriggerExit(Collider other) { if (other.gameObject.name.Contains("Panel") || other.gameObject.name.Contains("Tab")) { return; } interactive = null; }
private void DeselectLastInteractiveItem() { if (lastInteraciveItem == null) { return; } lastInteraciveItem.CursorOut(); lastInteraciveItem = null; }
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(); }
private void UpdateInteractiveItemsInformation() { if (lastInteraciveItem == currentInteractiveItem) { return; } currentInteractiveItem.CursorIn(); DeselectLastInteractiveItem(); lastInteraciveItem = currentInteractiveItem; }
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); }