Coder Social home page Coder Social logo

jsongameobject's Introduction

JSONGameObject

JSONGameObject allows to serialize/deserialize Unity3D GameObjects from JSON format.

Getting Started

Download and insert under /Assets folder of your Unity3D project, go to "What is required?" and no more is required.

What is required?

Requires Newtonsoft library or another deep JSON serializer, (JsonUtility from Unity3D doesnt work) https://github.com/SaladLab/Json.Net.Unity3D https://github.com/SaladLab/Json.Net.Unity3D/releases

Built with extension methods

Make it simple, use a gameObject, print or store the JSON result.

JSONGameObject jsonGameObject = gameObjectToSerialize.ToJSONGameObject();

//Print the result (Example made with NEWTONSOFT serialization)[NEWTONSOFT](https://github.com/SaladLab/Json.Net.Unity3D/releases)
Debug.Log(Newtonsoft.Json.JsonConvert.SerializeObject(jsonGameObject));

//Create a new gameObject from the jsonGameObject data
GameObject newGameObject = jsonGameObject.ToGameObject();

You can also load the json from WWW service or from file

//Get a textAsset (JSON generated or modified)
TextAsset textAsset = Resources.Load<TextAsset>(jsonPath);

//Use NEWTONSOFT or another json library to deserialize the string into a "JSONGameObject"
JSONGameObject jsonGameObject = Newtonsoft.Json.JsonConvert.DeserializeObject<JSONGameObject>(textAsset.text);

//Create a new gameObject from the generated jsonGameObject
jsonGameObject.ToGameObject();

Authors

  • Jesus García Urtiaga - Initial work

See also the list of contributors who participated in this project.

License

This project is licensed under the WTFPL – Do What the Fuck You Want to Public License - see the WTFPL web page for details.

Acknowledgments

  • All code is c#
  • Based in System.Reflections to generate/fill GameObjects and Components variables

jsongameobject's People

Contributors

mcklem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.