当前位置:网站首页>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);
}
}边栏推荐
- Which software is good for machine vision?
- day4
- [fluent] dart data type number type (DART file creation | num type | int type | double type | num related API)
- Conditions and solutions of deadlock
- 【5G NR】RRC连接释放
- End time processing method of wechat v3native payment settings
- mysql数据库mysqldump为啥没有创建数据库的语句
- Usage of group by
- PCL 点云镜像变换
- Yyds dry inventory KVM new inventory to expand space for home
猜你喜欢

结构体的内存对齐

SSM整合-异常处理器及项目异常处理方案

IDEA中设置背景图片(超详细)

Write your own CPU Chapter 11 - learning notes

Remove the underline in router link

Today in history: Alipay launched barcode payment; The father of time-sharing system was born; The first TV advertisement in the world

PyC file decompile

JS learning notes - variables

Practice of traffic recording and playback in vivo

历史上的今天:支付宝推出条码支付;分时系统之父诞生;世界上第一支电视广告...
随机推荐
Song of cactus - throwing stones to ask the way (3)
OSPF - detailed explanation of NSSA area and full NSSA area (including configuration command), LSA type 7 lsa-7
绝对真理和相对真理思考
Seal Library - installation and introduction
总结|机器视觉中三大坐标系及其相互关系
Practice of traffic recording and playback in vivo
OSPF - route aggregation [(summary) including configuration commands] | address summary calculation method - detailed explanation
虚假的暑假
理想之光不灭
The difference and usage of calloc, malloc and realloc functions
数学分析_笔记_第5章:一元微分学
Maui学习之路(三)--Winui3深入探讨
Processing gzip: stdin: not in gzip format: child returned status 1tar: error is not recoverable: exitin
Dimension table and fact table in data warehouse
HMS core machine learning service helps zaful users to shop conveniently
Data Lake (11): Iceberg table data organization and query
处理gzip: stdin: not in gzip formattar: Child returned status 1tar: Error is not recoverable: exitin
死锁的条件及解决方法
Idea jar package conflict troubleshooting
Set the background picture in the idea (ultra detailed)