/// <summary> /// The IsStateValid method is used to determine if the pointer is currently in a valid state (i.e. on it's valid colour). /// </summary> /// <returns>Returns `true` if the pointer is in the valid state (showing the valid colour), returns `false` if the pointer is in the invalid state (showing the invalid colour).</returns> public virtual bool IsStateValid() { return(EnabledPointerRenderer() && pointerRenderer.IsValidCollision()); }
protected virtual void ExecuteSelectionButtonAction() { if (EnabledPointerRenderer() && CanSelect() && (IsPointerActive() || wasActivated)) { wasActivated = false; RaycastHit destinationHit = pointerRenderer.GetDestinationHit(); AttemptUseOnSet(destinationHit.transform); if (destinationHit.transform && IsPointerActive() && pointerRenderer.ValidPlayArea() && !PointerActivatesUseAction(pointerInteractableObject) && pointerRenderer.IsValidCollision()) { ResetHoverSelectionTimer(destinationHit.collider); ResetSelectionTimer(); OnDestinationMarkerSet(SetDestinationMarkerEvent(destinationHit.distance, destinationHit.transform, destinationHit, destinationHit.point, controllerIndex)); } } }