Expose Behaviour.isActiveAndEnabled to Udon (or Create new property for UdonBehaviour)
tracked
BobyStar
GameObject.activeInHierarchy
is exposed and enabled
is exposed for most components. Having this would save on extra calls for checking of something is active and enabled, like during a custom event loop.I'm aware that
Behaviour
isn't exposed and such enabled
isn't available for every component. Related: https://feedback.vrchat.com/udon/p/expose-behaviour-types-both-singular-and-array-and-propertiesIf
Behaviour
cannot be exposed, I'd request for a new UdonBehaviour
property that does a similar thing just for UdonBehaviour
.Log In
Dexvoid
Merged in a post:
Expose Behaviour.isActiveAndEnabled
kawashirov
Some times you need to run logic only if some of other components are active.
It ispossible to check Behaviour's activity by:
- getting Behaviour's .gameObject
- getting gameObject.activeInHierarchy
- getting Behaviour.enabled
- doing logical AND.
All of the above is a difficult and has a large overhead, especially when trying to optimize Update and "cull" unnecessary logic.
In this case Behaviour.isActiveAndEnabled allows to check if Behaviour currently active by any reason simple and fast.
This post was marked as
tracked