Allow multiple selections in drop down

Hi all,

I am looking for a way to create a drop down menu in the inpsector that allows for multiple selections, similar to the visibility property on the Camera component (see image below). Is there a way to do something similar but for Physics groups on my own component’s property? Would anyone know if this is possible?

Many thanks.

Screen Shot 2022-01-20 at 4.42.05 PM

What version of Cocos Creator are you using?

Im using v. 3.4.0

image


maybe you want this?
If you want to customize the type, you can refer to this:
340engine\cocos\core\pipeline\define.ts

340engine\cocos\core\scene-graph\layers.ts

1 Like

Yep that worked perfectly. What I did was let PhysicsGroups = {...physics.PhysicsGroup}, then added the following:

@property({tooltip:“My description”})
_contactGroups = PhysicsGroups.DEFAULT;

get contactGroups() { return this._contactGroups; }
@type(BitMask(PhysicsGroups))
set contactGroups(val) { this._contactGroups = val; }

Thanks for your help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.