Expose Behaviour types (both singular and array) and properties
tracked
techanon
I want to be able to store references to components as a Behaviour type within an array, so I can loop through them and toggle the 'enabled' property on them as needed by the script.
Because Behaviour is the most generic type for many Unity types that has the 'enabled' property, it should be exposed so we don't have to explicitly cast check for other subtypes derived from Behaviour, which would cost extra EXTERN calls.
Specifically what I'd like exposed is:
Behaviour Type
Behaviour[] Type
Behaviour.enabled property (get/set)
Behaviour.isActiveAndEnabled property (get)
Other related post that specifically referred to isActiveAndEnabled
Log In
Dexvoid
Merged in a post:
Contacts enable property not exposed to Udon
TapGhoul
For whatever reason, .enabled has not been exposed to Udon for ContactSender and ContactReceiver directly, but can be done so via animations. This seems like an oversight to me.
SDK version is Worlds 3.10.1
Dexvoid
Merged in a post:
Allow enabling and disabling of arbitrary Components
poplopo
Setting components enabled or disabled is restricted to a limited list of component types. Would be most helpful for it to be available for any component type (similar to how VRCTrigger's Set Component Enabled worked in VRCSDK2).
Dexvoid
marked this post as
tracked
techanon
Hmm. Found another related. https://feedback.vrchat.com/vrchat-udon-closed-alpha-feedback/p/allow-enabling-and-disabling-of-arbitrary-components
Searching on canny is hard...
Genesis
Genesis
This is what I've been using to manage component states, but as you can see there are lots of unexposed components, some components don't expose their enabled property, and the whole solution is generally pretty awful and could be avoided with UnityEngine.Behaviour.enabled being exposed - https://gist.github.com/NGenesis/39a22821dd26edc1b8e84c1fcbe71df6.
LefTonbo
currently bulk enabling/disabling (can do in SDK2) is not doable because we cannot use Behaviour[] and Behaviour.enabled.
Genesis
UnityEngine.Behaviour.enabled needs to be exposed to allow this: https://feedback.vrchat.com/vrchat-udon-closed-alpha-bugs/p/unityenginebehaviourenabled-not-exposed
Kaj
Is UdonBehaviour.set enabled all that's missing? Or are there more components?
poplopo
Looks like UdonBehaviour doesn't have enabled because it doesn't have an Update function by default. I've learned more about the component functions at least! I'll keep an eye out for other components but maybe the current implementation is as thorough as it can get.