1.载入LitJson.dll文件
2.解析的主要代码
TextAsset textAsset= Resources.Load<TextAsset>("UIPanelJson"); //载入json文件 JsonData jsonData = JsonMapper.ToObject(textAsset.text); //将json信息解析成对象 foreach (JsonData item in jsonData) { string panelType = item["panelType"].ToString(); UIPanelType type = (UIPanelType)System.Enum.Parse(typeof( UIPanelType), panelType); string panelPath = item["path"].ToString(); //Debug.Log(type + "," + panelPath); panelsDic.Add(type, panelPath); }