当前位置:网站首页>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);
}
}边栏推荐
- 解决** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the defau
- 数学分析_笔记_第6章:一元函数的Riemann积分
- 潘多拉 IOT 开发板学习(RT-Thread)—— 实验2 RGB LED 实验(学习笔记)
- 头条 | 亚控科技产品入选中纺联《纺织服装行业数字化转型解决方案重点推广名录》
- Summary of monthly report | list of major events of moonbeam in June
- Introduction to database system Chapter 1 short answer questions - how was the final exam?
- Win11应用商店无法加载页面怎么办?Win11商店无法加载页面
- [fluent] dart language (DART language features | JIT instant compilation | AOT static compilation)
- 注册成为harmonyos开发者并安装DevEco Studio 3.0 Beta2 for HarmonyOS
- sql解决连续登录问题变形-节假日过滤
猜你喜欢

Mathematical analysis_ Notes_ Chapter 5: univariate differential calculus

Vscode设置标签页多行显示

Pandora IOT development board learning (RT thread) - Experiment 2 RGB LED experiment (learning notes)

中国信通院《数据安全产品与服务图谱》,美创科技实现四大板块全覆盖

自注意力机制和全连接的图卷积网络(GCN)有什么区别联系?

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

Write your own CPU Chapter 11 - learning notes

After the win10 system is upgraded for a period of time, the memory occupation is too high

Dimension table and fact table in data warehouse

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...
随机推荐
Mathematical analysis_ Notes_ Chapter 5: univariate differential calculus
Effectively use keywords to increase Amazon sales
Summary | three coordinate systems in machine vision and their relationships
False summer vacation
Data Lake (11): Iceberg table data organization and query
After the win10 system is upgraded for a period of time, the memory occupation is too high
忆当年高考|成为程序员的你,后悔了吗?
云原生的 CICD 框架:Tekton
Dimension table and fact table in data warehouse
End time processing method of wechat v3native payment settings
Recalling the college entrance examination and becoming a programmer, do you regret it?
Add user-defined formula (time sharing t+0) to mobile app access as an example
Song of cactus - throwing stones to ask the way (3)
Summary of monthly report | list of major events of moonbeam in June
In memory of becoming the first dayu200 tripartite demo contributor
数仓中的维度表与事实表
Practice of constructing ten billion relationship knowledge map based on Nebula graph
Sqlserver queries which indexes are underutilized
Maui learning road (III) -- in depth discussion of winui3
IDEA中设置背景图片(超详细)