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}"); } }
private bool GetPointable() { if (hit.collider == null) { return(false); } PointableObject pointableObject = hit.collider.gameObject.GetComponent <PointableObject>(); return(pointableObject != null); }
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}"); } }
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}"); } }