Hi. I’d like to be able to have a component property that allows multiple selections in the Inspector. For some physics settings, I’ve managed to create a dropdown to allow me to pick a layer from those listed in the Node layer manager but I’m struggling when it comes to allowing the user to select multiple layers (like you can in the inspector for the Camera component’s Visibility property). Once I have this, it is easy to know which layers I can use for specific raycasts etc.
I’ve tried to make custom property drawers with help from the docs and other online sources but none of these work (some even give examples which register the drawer to the Editor module using Editor.addPropertyDrawer but I cannot locate the Editor module in CC3.8.5 as it’s not listed in the Project Settings, Preferences or the Extension Manager).
In Unity, I can just use a LayerMask but there doesn’t seem to be an equivalent in CC. Any help or guidance would be most welcome as I’m new to Cocos.
Thank you so much, that worked perfectly! I had tried the Layers.BitMask approach but it would only ever display as a number in the Inspector. I only had a quick look at the definition files for the Camera component, not the full source code on GitHub, so never spotted the use of @type before the property get/set. I’m not used to having full source code access to an engine so will note this for future problems.