Add delayed enable/disable support for Behaviour components
VRCTween.DelayedSetActive
was recently added, and I have found it very useful.
I would like to request a similar shortcut for delayed changes to
Behaviour.enabled
.
## Background
VRCTween already provides many convenient shortcut methods, including
DelayedSetActive
.
It also has built-in tween support for components such as
AudioSource
and
Image
. These components inherit from
Behaviour
, so enabling or disabling them after a delay is a natural use case.
Currently, if we want to enable or disable a
Behaviour
after a delay, we need to create custom wrapper logic in Udon.
Having a built-in shortcut would make this pattern more concise and consistent with
DelayedSetActive
.
## Example
Current approach:
public Behaviour target;
public void DisableLater()
{
SendCustomEventDelayedSeconds(nameof(DisableTarget), delay);
}
public void DisableTarget()
{
target.enabled = false;
}
Proposed:
// Example only.
VRCTween.DelayedSetEnabled(target, false, delay);
## Benefits
* Consistent with
DelayedSetActive
* Useful for
Behaviour
components such as
AudioSource
,
Image
, and many others
* Reduces boilerplate Udon code
* Makes delayed enable/disable operations easier to read