-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User defined variables in the editor window #9
Comments
That's a feature that unity developers always ask and definitively we have to think on a solution for it. In Phaser there is the "data" property (Phaser.Sprite.data) that has that function of "custom properties". We already support it in the editor, you can edit the "data" and write its JSON value: http://phasereditor.boniatillo.com/blog/quick-start/080-canvas#DataEditor Sure, it is not so powerful as the Unity model and I am going to think about how to improve the editor in that field. To extract custom properties from JavaScript code could be difficult since there is many ways to do it, it is not like in C#, but we should find a way. |
The problem with the current data property is that it only works on Phaser.Sprite objects, not Phaser.Group objects. Having a similar capability on groups would be very helpful. |
the |
Thinking on this again. |
Hi @tomblind, Done. Now you can define "public" properties in the prefab, and change the property value in the prefab instance. Key differences with Unity:
Here is the documentation: https://help.phasereditor2d.com/v3/scene-editor/prefab-user-properties.html This is a video about it: https://www.youtube.com/watch?v=3ppowkkgz8Q |
(from http://www.bluesaltgames.com developers email)
User defined variables in the editor window – this one is critical. On unity I can create a variable that’s “public” in the code and it’ll show up on the editor for me to alter. This way I can create a prefab with a “life” variable, and create different monsters from that prefab by altering their individual values. This is one of the massively powerful features in Unity and I strongly recommend you to mimic it.
The text was updated successfully, but these errors were encountered: