開発環境
- Unity 5.4.3f1
using UnityEngine; public class NewBehaviourScript : MonoBehaviour { class ExampleClass { public int[] list1 = new int[]{ 1,2,3,4,5 }; public int[,] list2 = new int[,] { { 1,2,3,4,5 }, { 1,2,3,4,5 } }; public int[][] list3 = new int[5][]; } private void Awake() { var obj = new ExampleClass(); var json = JsonUtility.ToJson( obj ); Debug.Log( json ); } }
{"list1":[1,2,3,4,5]}
多次元配列やジャグ配列をあまり使用しない関係で知らなかったのでメモ