当前位置:网站首页>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);
}
}
边栏推荐
- 数据安全产业系列沙龙(三)| 数据安全产业标准体系建设主题沙龙
- Does bone conduction earphone have external sound? Advantages of bone conduction earphones
- Sqlserver queries which indexes are underutilized
- 理想之光不灭
- Sim2real environment configuration tutorial
- Boot 事务使用
- mysql min() 求某条件下最小的值出现多个结果
- Idea jar package conflict troubleshooting
- Idea public method extraction shortcut key
- Source code look me
猜你喜欢
Huawei ECS installs mysqlb for mysqld service failed because the control process exited with error code. See “sys
Trigger: MySQL implements adding or deleting a piece of data in one table and adding another table at the same time
关于mysql安装的一些问题
月报总结|Moonbeam6月份大事一览
After the win10 system is upgraded for a period of time, the memory occupation is too high
JS learning notes - process control
触发器:Mysql实现一张表添加或删除一条数据,另一张表同时添加
Maui学习之路(三)--Winui3深入探讨
idea 公共方法抽取快捷键
数学分析_笔记_第5章:一元微分学
随机推荐
[5g NR] RRC connection release
触发器:Mysql实现一张表添加或删除一条数据,另一张表同时添加
Figure database | Nepal graph v3.1.0 performance report
七一献礼:易鲸捷 “百日会战”完美收官 贵阳银行数据库提前封板
Win11应用商店无法加载页面怎么办?Win11商店无法加载页面
一文读懂AGV的关键技术——激光SLAM与视觉SLAM的区别
中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖
Everyone Xinfu builds: a one-stop intelligent business credit service platform
day4
台积电全球员工薪酬中位数约46万,CEO约899万;苹果上调日本的 iPhone 售价 ;Vim 9.0 发布|极客头条...
Analyzing more than 7million R & D needs, it is found that these eight programming languages are the most needed in the industry!
Maui learning road (III) -- in depth discussion of winui3
Dimension table and fact table in data warehouse
Song of cactus - throwing stones to ask the way (2)
Vscode设置标签页多行显示
外企高管、连续创业者、瑜伽和滑雪高手,持续迭代重构的程序人生
PCL 点云镜像变换
SSM整合-异常处理器及项目异常处理方案
MySQL calculates the data within the longitude and latitude range
Storage, reading and writing of blood relationship data of Nepal Graph & Data Warehouse