feat: particle options

This commit is contained in:
cha0s 2020-06-23 22:08:34 -05:00
parent fd374588b8
commit a32159cee9
2 changed files with 8 additions and 0 deletions

View File

@ -435,4 +435,8 @@ export default class Entity extends decorate(Resource) {
};
}
traitInstance(type) {
return this._traits[type];
}
}

View File

@ -41,6 +41,10 @@ export default class Emitter extends decorate(Trait) {
args: [
['key', {
type: 'string',
options: (entity) => (
Object.keys(entity.traitInstance('emitter').particles)
.reduce((r, key) => ({...r, [key]: key}), {})
),
}],
['json', {
type: 'object',