Skip to content

TPS-Geronam/SimpleObjectPort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleObjectPort

A simple implementation of an object serialization system for Unity3D. Serializes Unity objects to JSON files using EditorJsonUtility (in editor) or JsonUtility (runtime). Includes a custom editor window for exporting and importing ScriptableObject assets via GUI.

Last tested on Unity 6.4

Dependencies

Usage

var savedPath = await ObjectPort.Save(object);
var json = await ObjectPort.Load(savedPath);

Or simply use the editor: Window > SimpleObjectPort > ObjectPort

Thoughts

  • exception handling is the responsibility of the caller
  • ObjectPortEditor.HandleImportAsync() uses ScriptableObject.CreateInstance(className)
    • loading non-SOs in the custom editor will not work
  • loading asset or object references at runtime will not work
    • if you have to, create a lookup table
  • you don't have to use ScriptableObject like the custom editor, any serializable C# class will work
    • probably a good idea to save or load only value types ?

About

Simple JSON object serialization for Unity3D

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages