From 1596bcf21fe6f43ecf70b6c25bdd3a6ad0be88cb Mon Sep 17 00:00:00 2001 From: zhangaotian <8474238@qq.com> Date: Fri, 19 Jul 2024 15:27:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Bug=E3=80=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Forest/Assets/Editor/GameBuild/GameBuildWindow.cs | 6 ++++-- .../Assets/Scripts/Framework/Manager/BuildManager.cs | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Forest/Assets/Editor/GameBuild/GameBuildWindow.cs b/Forest/Assets/Editor/GameBuild/GameBuildWindow.cs index ce50f8e..ed0dc43 100644 --- a/Forest/Assets/Editor/GameBuild/GameBuildWindow.cs +++ b/Forest/Assets/Editor/GameBuild/GameBuildWindow.cs @@ -145,8 +145,10 @@ public class GameBuildWindow : OdinEditorWindow curBuildData.NodeInfos = new List(curBuildData.nodeCount); for (int i = 0; i < curBuildData.nodeCount; i++) { - var node = new BuildData.BuildNode(); - node.Name = string.Format(NodeName, i + 1); + var node = new BuildData.BuildNode + { + Name = string.Format(NodeName, i + 1) + }; curBuildData.NodeInfos.Add(node); } diff --git a/Forest/Assets/Scripts/Framework/Manager/BuildManager.cs b/Forest/Assets/Scripts/Framework/Manager/BuildManager.cs index c679723..53db900 100644 --- a/Forest/Assets/Scripts/Framework/Manager/BuildManager.cs +++ b/Forest/Assets/Scripts/Framework/Manager/BuildManager.cs @@ -3,6 +3,7 @@ using PhxhSDK; using System.IO; using UnityEngine; using System.Linq; +using LC.Newtonsoft.Json; using Framework.GameBuild; using Sirenix.OdinInspector; using Cysharp.Threading.Tasks; @@ -57,6 +58,17 @@ namespace Framework.Manager [HideInInspector] public List Options; [HideInInspector] public string IconPath; + + [JsonConstructor] + public BuildNode(string name) + { + this.Name = name; + } + + [JsonConstructor] + public BuildNode() + { + } } }