You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create type for serializing GameObject, to begin with. This idea spans all UnityEngine.Object types. But some fake GameObject type that can be freely serialized and deserialized without creating objects that Unity starts tracking and adding into the scene.
Would allow deserializing of types. Accompanied by some helper methods such as FakeGameObject.ApplyTo(GameObject target) and FakeGameObject.Instantiate().
Would also be good with some deserializing abstract class that the user can define to be able to control wether to instantiate some objects or wether to apply it to an existing object (maybe based on some type or ID field for that object in particular). Perhaps by using the visitor pattern.
A cleaner solution would be to abuse JObject or something, and only having to implement the deserializing logic. Gets complicated when you have to factor in user-defined MonoBehaviours and such
A veeery low prio item but it's still possible to pull off.
Motivation
This is where the idea falls flat.
The cool factor is one aspect.
If it spans most UnityEngine.Object types then it could be used as an alternative scene saving, but without UnityEditor dependency. Maybe as a very simplified (but overpowered) save functionality?
Using it for saving would be bad practice though as it would save far too much info not needed, and perhaps even make it worse when it comes to supporting updates. Users are better off implementing their own save functionality by using custom structs/classes to store information, loaded into prefabs.
Could be good if you want to create a world builder though 🤔 but we already have Unity for that anyways.
So it only lands on cool factor. :/ Would be fun to develop though!
That walks the different types and tries to apply the values onto an existing object or instantiate a new one. Working sort of from the deepest to the root (but having to deal with GameObject may not exist that Component is trying to be created onto).
The text was updated successfully, but these errors were encountered:
Description
Create type for serializing GameObject, to begin with. This idea spans all UnityEngine.Object types. But some fake GameObject type that can be freely serialized and deserialized without creating objects that Unity starts tracking and adding into the scene.
Would allow deserializing of types. Accompanied by some helper methods such as
FakeGameObject.ApplyTo(GameObject target)
andFakeGameObject.Instantiate()
.Would also be good with some deserializing abstract class that the user can define to be able to control wether to instantiate some objects or wether to apply it to an existing object (maybe based on some type or ID field for that object in particular). Perhaps by using the visitor pattern.
A cleaner solution would be to abuse JObject or something, and only having to implement the deserializing logic. Gets complicated when you have to factor in user-defined MonoBehaviours and such
A veeery low prio item but it's still possible to pull off.
Motivation
This is where the idea falls flat.
The cool factor is one aspect.
If it spans most UnityEngine.Object types then it could be used as an alternative scene saving, but without UnityEditor dependency. Maybe as a very simplified (but overpowered) save functionality?
Using it for saving would be bad practice though as it would save far too much info not needed, and perhaps even make it worse when it comes to supporting updates. Users are better off implementing their own save functionality by using custom structs/classes to store information, loaded into prefabs.
Could be good if you want to create a world builder though 🤔 but we already have Unity for that anyways.
So it only lands on cool factor. :/ Would be fun to develop though!
Suggested solution
Some class, such as this one:
That walks the different types and tries to apply the values onto an existing object or instantiate a new one. Working sort of from the deepest to the root (but having to deal with GameObject may not exist that Component is trying to be created onto).
The text was updated successfully, but these errors were encountered: