This commit is contained in:
wulongxiao 2025-01-08 13:40:33 +08:00
parent 0d03241a5a
commit 597a4ca9cd
2 changed files with 9 additions and 18 deletions

View File

@ -4372,7 +4372,6 @@ GameObject:
- component: {fileID: 1337722729} - component: {fileID: 1337722729}
- component: {fileID: 1337722730} - component: {fileID: 1337722730}
- component: {fileID: 1337722731} - component: {fileID: 1337722731}
- component: {fileID: 1337722732}
m_Layer: 0 m_Layer: 0
m_Name: ReadJson m_Name: ReadJson
m_TagString: Untagged m_TagString: Untagged
@ -4428,20 +4427,6 @@ MonoBehaviour:
description: description:
MapLevelJson: {fileID: 4900000, guid: b534002cbb7fddf4bb68f34fb1357ff3, type: 3} MapLevelJson: {fileID: 4900000, guid: b534002cbb7fddf4bb68f34fb1357ff3, type: 3}
count: 0 count: 0
--- !u!114 &1337722732
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1337722728}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 39d4d2c40e6ce1e45bb8069dc25b05e8, type: 3}
m_Name:
m_EditorClassIdentifier:
description:
_Json: {fileID: 0}
--- !u!1 &1342038372 --- !u!1 &1342038372
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -6,13 +6,19 @@ using UnityEngine;
public class Mengyao_Skill_Date : JsonReadBase public class Mengyao_Skill_Date : JsonReadBase
{ {
public string _Json = "{\r\n \"M_H_001\": {\r\n \"M_H_001_S_1\": {\r\n \"1\": {\r\n \"Range\":2\r\n },\r\n \"2\": {\r\n \"DamageBuff\": 0.15\r\n },\r\n \"3\": {\r\n \"SkillList\": [\"skill_0\"],\r\n \"Range\": -1\r\n },\r\n \"4\": {\r\n \"DamageBuff\": 0.35\r\n },\r\n \"5\": {\r\n \"AttackCooldown\": -0.5,\r\n \"AttackContinues\":-0.5\r\n }\r\n },\r\n \"M_H_001_S_2\": {\r\n \"1\": {\r\n \"SkillList\": [\r\n \"skill_1\"\r\n ],\r\n \"DamageBuff\": -0.5\r\n },\r\n \"2\": {\r\n \"DamageBuff\": 0.15\r\n },\r\n \"3\": {\r\n \"SkillList\": [\r\n \"skill_2\"\r\n ],\r\n \"AttackCooldown\": 0.05\r\n },\r\n \"4\": {\r\n \"DamageBuff\": 0.35\r\n },\r\n \"5\": {\r\n \"AttackCooldown\": 0.3,\r\n \"AttackContinues\": 0.5\r\n }\r\n }\r\n }\r\n}"; public TextAsset _Json;
public Dictionary<string, Dictionary<string, Dictionary<string, SkillLevelData>>> parsedData; public Dictionary<string, Dictionary<string, Dictionary<string, SkillLevelData>>> parsedData;
void Awake() void Awake()
{ {
print(_Json);
// 解析 JSON 数据 // 解析 JSON 数据
parsedData = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, Dictionary<string, SkillLevelData>>>>(_Json); //parsedData = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, Dictionary<string, SkillLevelData>>>>(_Json.text.Trim());
}
void Start()
{
// ½âÎö JSON Êý¾Ý
parsedData = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, Dictionary<string, SkillLevelData>>>>(_Json.text.Trim());
} }
} }