using System; using UnityEngine; namespace Plugins.CxShine.net { // 出处 :https://forum.unity3d.com/threads/how-to-load-an-array-with-jsonutility.375735/#post-2585129 public class JsonHelper { public static T[] getJsonArray(string json) { var newJson = "{ \"array\": " + json + "}"; var wrapper = JsonUtility.FromJson>(newJson); return wrapper.array; } [Serializable] private class Wrapper { public T[] array; } } }