Prefab user properties
- Creating a prefab user property
- Simple property type
- Option property type
- Color property type
- Expression property type
- Object Variable property type
- Object Constructor property type
- Event property type
- Key Code property type
- Texture Config property type
- Asset Key property type
- Animation Key property type
- Audio Key property type
- Scene Key property type
- Spine Skin Name property type
- Spine Animation Name property type
- Initializing other properties
- User properties in a prefab instance
As we mentioned in previous sections, a prefab extends a Phaser built-in type or another prefab. This means a prefab inherits the properties defined in the Phaser built-in types. However, you have the option to define new properties.
With prefab user properties, you can create more reusable prefabs. You can express gameplay concepts: the “health” of a player, the “value” of a coin, the “speed” of an enemy, etc.