GameObjectSerialization.txt 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. TODO
  2. - Ability to break external references as a pre-processing step
  3. ---------------------------------------
  4. IMMEDIATE:
  5. ScriptSerializableObjectRTTI::onDeserializationEnded
  6. - Compare stored and new SerializableObjectInfo (if it even exists)
  7. - Must ensure the object info instances match
  8. - (I might also want to compare type class/struct status in case it changed)
  9. - Create new managed object instance
  10. - Fill out the class fields (those whose types match the new SerializableObjectInfo->mFields)
  11. ScriptSerializableArrayRTTI::onDeserializationEnded
  12. - Attempt to create new managed object instance
  13. Need Object & Array ScriptSerializableField classes
  14. ManagedComponent needs to create SerializableObject and return it in its RTTI
  15. When deserializing SerializableObjectInfo base classes references won't be held anywhere (they're only pointed to by mBaseClass which is a weak_pointer)
  16. In ScriptEnginePlugin I am running RuntimeScriptObjects but never shutting it down - Right now its only for debug purposes
  17. LOW PRIORITY
  18. - Add Multi-dimensional arrays / Lists / Dictionaries
  19. - (To get array lengths per rank I probably need to cast to System.Array and then call GetLength)
  20. - Ensure that unknown components retain their field data so when they are no longer unknown their data may be restored
  21. - Get rid of ScriptObject::createInstance and replace it with parameter in constructor
  22. - A way to serialize any object into a Resource (and deserialize it from Resource)
  23. ---------------------------------------
  24. Testing:
  25. Set up a test case - Initially disable field serialization
  26. - In C# create SceneObject("ManagedSO")
  27. - Add to it DbgComponent
  28. - Call a dummy C++ method (in ScriptSceneObject for example)
  29. - C++ method calls clone() on the scene object and creates a new "ManagedSOClone" object and parents it as a child of current SO
  30. - C# then retrieves a child and checks if the component is there
  31. ------------------------------------------------------
  32. General C# component management
  33. Native components like Camera
  34. - ScriptCamera derives from Camera
  35. - Then whenever I check for managed Components I need to check if object type of ScriptComponent or
  36. any of the built-in types.
  37. - Checking each type might be a bit slow, but normally we will be looking for an exact type
  38. so hopefully this will only matter when enumerating all components which shouldn't be during performance
  39. critical moments.
  40. TODO - When reloading scripts how to handle restoring references?
  41. TODO - When I destroy a Component, how will I refresh the inspector to let it know that something has changed
  42. - Can happen from C# and C++
  43. -------------------------------------------------------
  44. Other:
  45. Instantiating mono generic classes: http://stackoverflow.com/questions/17628411/get-generic-type-using-mono-embedded