-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ScriptableObjects as Blueprints #373
Comments
That's a good idea actually, If Blueprints are supposed to be a unity only thing but currently a blueprint is wrapped within a scriptableobject and draw using inspector code. This way you could load a blueprint from file and apply it that way as well. |
You mean someone wants to use blueprints in non-Unity apps? If that is the case then current blueprints probably already work for them. In Unity, it is far better to have things serialized by Unity itself. This approach can work with runtime serialization, this class is perfectly serializable. And if you want non-Unity, this can be wrapped. I need help making this. I have no experience with reflection, so I think code generation will be hard for me. (At least so I thought, now I'm looking into code generator.) Unless current blueprints can be as reliable and are easier to make work, and unless they also can serialize everything this example can, I think this is a good way to go. This one potentially supports even refactoring with [FormerlySerializedAs] which Entitas could utilize. |
Actually, game state saving and blueprint integrated system seem pretty simple.
This would make a very easy to use runtime serializer out of the blueprint system.
|
I'm sure it has something to do with "portability" here, but I've been studying Blueprints lately and thought about doing something like this myself since I noticed Blueprints don't currently support Unity undo operations and switching context erases all blueprint components! This is really ridiculous and annoying, but I believe replacing the binary formatter should fix all that and I hope to help in this area eventually, but I still don't know enough about the system yet to contribute anything. I have however at least been able to fix some aspects of the blueprint inspector already. |
I think it can be portable by breaking down in 2-3 files and just using a ScriptableObject as a wrapper, but it might be easier to just generate Unity version separately. Internally they both would implement the same interface, so it is just a matter of one code generator addon for Unity. Blueprints are already pretty unity-specific at least partially. |
Fyi, due to #390 I cannot work on blueprint related issues. Blueprints can become a community supported feature. |
I think I have read in the chat that someone was implementing something like this. Whoever it was, please respond here if you have some progress or have it working already 😄 |
@VladislavKostin Not sure but is it me or someone else? |
@pixeption Idk, possibly. Were you working on this? How is it going? |
This would make a good Entitas Plus feature :) |
It's not going anywhere for now. Should I close it? 😄 |
I still want this to happen because I now use scriptableobject as blueprint by manually create it. |
@VladislavKostin sorry for late response Actually I worked on something different, I don't want blueprint as scriptable object, I want to attach entitas components into GameObject (For example many game level require design on Editor for productivity). At the end I gave up (although it can run) since it is contained many cheat code & limited when using Unity serialization. Writing code to generate scriptable object as blueprint is not hard, you can check how blueprint generate in source code and do the same thing. (actually I learn a lot of reflection and code generation via entitas) |
@pixeption Isn't it almost the same code though? Mine and what you tried to achieve? Just change |
@VladislavKostin It's actually difference. I succeed at serialize entitas component using Unity Serialization via many tricks. Here is a demo but i don't think this is a good approach, maybe I'll think about another approach |
Why not just generate scriptable objects and use them as blueprints? I slapped together some example of a code that could be generated:
This one actually works, just put property drawers on top and it seems to be a fully-functioning blueprint with Unity serialization. No problems. Right?..
The text was updated successfully, but these errors were encountered: