Keep action active

InteractionRaycaster subscribes to interaction when looks at it, and unsubscribe when it disappear from center of screen. But, what to do if you want to keep action on, based on some conditions?

In this case, you can use IsUnsubscribeBlocked()

public override bool IsUnsubscribeBlocked() => holdState == HoldState.Holding;

If unsubscribe is blocked (by this method) InteractionRaycaster will not unsubscribe this action, and you can unsubscribe it yourself by calling Unsubscribe().

Last updated