private void ParseUIPanelTypeJson() { panelPathDict = new Dictionary <UIPanelType, string> (); TextAsset ta = Resources.Load <TextAsset>("UIPanelType"); UIPanelJson panelInfoList = JsonUtility.FromJson <UIPanelJson> (ta.text); foreach (UIPanelInfo info in panelInfoList.infoList) { panelPathDict.Add(info.paneltype, info.Path); } }
private void ParseUIPanelTypeJson() { panelPathDict = new Dictionary <UIPanelType, string>(); TextAsset ta = Resources.Load <TextAsset>("UIPanelType"); UIPanelJson jsonObject = JsonMapper.ToObject <UIPanelJson>(ta.text); foreach (PanelInfo info in jsonObject.infoList) { UIPanelType type = (UIPanelType)System.Enum.Parse(typeof(UIPanelType), info.panelTypeString); panelPathDict.Add(type, info.path); } }