当前位置:网站首页>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);
}
}
边栏推荐
- Pandora IOT development board learning (RT thread) - Experiment 2 RGB LED experiment (learning notes)
- idea jar包冲突排查
- Today in history: Alipay launched barcode payment; The father of time-sharing system was born; The first TV advertisement in the world
- Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin
- idea 公共方法抽取快捷键
- Yyds dry goods inventory hands-on teaching you to carry out the packaging and release of mofish Library (fishing Library)
- [fluent] dart data type number type (DART file creation | num type | int type | double type | num related API)
- JS learning notes - variables
- Song of cactus - throwing stones to ask the way (2)
- Vscade set multi line display of tab
猜你喜欢
Summary of monthly report | list of major events of moonbeam in June
JS learning notes - variables
Understand the key technology of AGV -- the difference between laser slam and visual slam
Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse
历史上的今天:支付宝推出条码支付;分时系统之父诞生;世界上第一支电视广告...
数学分析_笔记_第6章:一元函数的Riemann积分
数仓中的维度表与事实表
Summary of multithreading and thread synchronization knowledge
Some problems about MySQL installation
OSPF - detailed explanation of NSSA area and full NSSA area (including configuration command), LSA type 7 lsa-7
随机推荐
Aujourd'hui dans l'histoire: Alipay lance le paiement par code à barres; La naissance du père du système de partage du temps; La première publicité télévisée au monde...
Sqlserver queries which indexes are underutilized
数仓中的维度表与事实表
Does bone conduction earphone have external sound? Advantages of bone conduction earphones
Flink real-time data warehouse (7): Flink realizes the full pull module to extract data in MySQL
Yyds dry inventory executor package (parameter processing function)
曆史上的今天:支付寶推出條碼支付;分時系統之父誕生;世界上第一支電視廣告...
[5g NR] RRC connection release
SSM integration exception handler and project exception handling scheme
理想之光不灭
Various entanglements between qvariant and Jason -- QT
头条 | 亚控科技产品入选中纺联《纺织服装行业数字化转型解决方案重点推广名录》
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条...
潘多拉 IOT 开发板学习(RT-Thread)—— 实验2 RGB LED 实验(学习笔记)
自注意力机制和全连接的图卷积网络(GCN)有什么区别联系?
dried food! Understand the structural vulnerability of graph convolution networks
JS learning notes - data types
JS learning notes - variables
华为云服务器安装mysqlb for mysqld.service failed because the control process exited with error code.See “sys
How to use stustr function in Oracle view