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() + { + } } }