当前位置:网站首页>Written by unity Jason
Written by unity Jason
2022-07-02 16:25:00 【Yun Xiaochuan】
Json Online editing , Convert to parsing class website :JSON turn C# Entity class -BeJSON.com
{
"ConfigInfo": [
{
"Name": " red tourism ",
"Audio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ParentPointItmes": [
{
"PointName": " red tourism 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ChildPointItmes": [
{
"PointName": " Former residence of Chen Yi 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Jinggang Mountains 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " The former site of Zunyi Conference 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
}
]
},
{
"PointName": " red tourism 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ParentPointItmes": [
{
"PointName": " Former residence of Chen Yi 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Jinggang Mountains 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " The former site of Zunyi Conference 3",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
}
]
}
]
},
{
"Name": " Red showroom ",
"Audio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ParentPointItmes": [
{
"PointName": " Red showroom 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ChildPointItmes": [
{
"PointName": " Anti Japanese War Memorial 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Liberation War Memorial 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " found a party 100 Anniversary of the 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
}
]
},
{
"PointName": " Red showroom 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ChildPointItmes": [
{
"PointName": " Anti Japanese War Memorial 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Liberation War Memorial 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " found a party 100 Anniversary of the 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
}
]
}
]
},
{
"Name": " Clean government education ",
"Audio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ParentPointItmes": [
{
"PointName": " Clean government education 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ChildPointItmes": [
{
"PointName": " Integrity one 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Integrity one 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Integrity one 3",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
}
]
},
{
"PointName": " Clean government education 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png",
"ChildPointItmes": [
{
"PointName": " Integrity II 1",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Integrity II 2",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
},
{
"PointName": " Integrity II 3",
"PointAudio": "/Audios/1631001459775.mp3",
"ImageUrl": "/Images/ Xiangshan Memorial Hall /2021-05-25 11_14_07_043.png"
}
]
}
]
}
]
}Parsing class :
// If easy to use , Please collect the address , Help share .
using System;
using System.Collections.Generic;
[Serializable]
public class ChildPointItmesItem
{
/// <summary>
///
/// </summary>
public string PointName;
/// <summary>
///
/// </summary>
public string PointAudio;
/// <summary>
///
/// </summary>
public string ImageUrl;
}
[Serializable]
public class ParentPointItmesItem
{
/// <summary>
///
/// </summary>
public string PointName;
/// <summary>
///
/// </summary>
public string PointAudio;
/// <summary>
///
/// </summary>
public string ImageUrl;
/// <summary>
///
/// </summary>
public List<ChildPointItmesItem> ChildPointItmes;
}
[Serializable]
public class ConfigInfoItem
{
/// <summary>
///
/// </summary>
public string Name;
/// <summary>
///
/// </summary>
public string Audio;
/// <summary>
///
/// </summary>
public string ImageUrl;
/// <summary>
///
/// </summary>
public List<ParentPointItmesItem> ParentPointItmes;
}
public class Root
{
/// <summary>
///
/// </summary>
public List<ConfigInfoItem> ConfigInfo;
}
Calling method :
public Transform transform;
void Start()
{
// file found
string jsonTest = File.ReadAllText("D:/Data.json", Encoding.UTF8);
// Call directly Unity Provided interface JsonUtility.FromJson You can realize parsing
List<ConfigInfoItem> configInfo = JsonUtility.FromJson<Root>(jsonTest).ConfigInfo;
Debug.Log(jsonTest);
for (int i = 0; i < configInfo.Count; i++)
{
Debug.Log(configInfo[i].Name);
//GlobalFunction.CreationUI("ItmeList", transform);
}
}边栏推荐
- 数据安全产业系列沙龙(三)| 数据安全产业标准体系建设主题沙龙
- 学生选课系统(山东农业大学课程设计)
- 去除router-link中的下划线
- 中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
- sim2real环境配置教程
- 死锁的条件及解决方法
- Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys
- 绝对真理和相对真理思考
- [solution] educational codeforces round 82
- JS learning notes - data types
猜你喜欢

处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin

原神2.6服务端下载以及搭建安装教程

JS learning notes - variables

Text intelligent expansion and contraction control of swiftui text component (tutorial includes source code)

Register as a harmonios developer and install deveco studio 3.0 beta2 for harmonios

What is Amazon keyword index? The consequences of not indexing are serious

去除router-link中的下划线

Summary of multithreading and thread synchronization knowledge

Boot 事务使用
![[5g NR] RRC connection release](/img/f3/a03f5124493b1c03e7336c55871330.png)
[5g NR] RRC connection release
随机推荐
Add user-defined formula (time sharing t+0) to mobile app access as an example
云原生的 CICD 框架:Tekton
Thinking about absolute truth and relative truth
中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
What is the difference between self attention mechanism and fully connected graph convolution network (GCN)?
Maui学习之路(三)--Winui3深入探讨
Mathematical analysis_ Notes_ Chapter 6: Riemann integral of univariate function
[solution] educational codeforces round 82
Boot 连接 Impala数据库
注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
七一献礼:易鲸捷 “百日会战”完美收官 贵阳银行数据库提前封板
[Yu Yue education] reference materials of sensing and intelligent control technology of Nanjing University of Technology
历史上的今天:支付宝推出条码支付;分时系统之父诞生;世界上第一支电视广告...
[fluent] dart data type string type (string definition | string splicing | string API call)
[fluent] dart data type number type (DART file creation | num type | int type | double type | num related API)
Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin
Mobile web development learning notes - Layout
学生选课系统(山东农业大学课程设计)
JS learning notes - process control
Typescript array out of order output