Skip to content

Instantly share code, notes, and snippets.

@alvarezgarcia
Created April 7, 2017 21:49
Show Gist options
  • Save alvarezgarcia/532c437cfc7645a6d429b15bce8814df to your computer and use it in GitHub Desktop.
Save alvarezgarcia/532c437cfc7645a6d429b15bce8814df to your computer and use it in GitHub Desktop.
JSONObject fromDirection = new JSONObject ();
fromDirection.AddField("x", Vector3.up.x);
fromDirection.AddField("y", Vector3.up.y);
fromDirection.AddField("z", Vector3.up.z);
JSONObject position = new JSONObject ();
position.AddField("x", contact.point.x);
position.AddField("y", contact.point.y);
position.AddField("z", contact.point.z);
JSONObject toDirection = new JSONObject ();
toDirection.AddField("x", contact.normal.x);
toDirection.AddField("y", contact.normal.y);
toDirection.AddField("z", contact.normal.z);
JSONObject json = new JSONObject();
json.AddField("event", "instantiate");
json.AddField("name", "energyExplosion");
json.AddField ("fromDirection", fromDirection);
json.AddField ("toDirection", toDirection);
json.AddField ("position", position);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment