Created
November 14, 2017 04:16
-
-
Save HituziANDO/c51a7a3a5035f4df6d0cbb839af77e39 to your computer and use it in GitHub Desktop.
Revisions
-
HituziANDO created this gist
Nov 14, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,43 @@ using UnityEngine; using System; using System.Collections.Generic; namespace MyApplication { /// <summary> /// JsonUtilityはルートが配列の場合は扱えないため、オブジェクトでラップするクラスです。 /// /// { "array": [ 指定した配列要素 ] } /// /// </summary> [Serializable] public class JsonArray<T> { [SerializeField] private T[] array; public JsonArray(T[] array) { this.array = array; } public JsonArray(List<T> list) { this.array = list.ToArray(); } public List<T> ToList() { return new List<T>(array); } public T[] Array { get { return this.array; } } } }