示例#1
0
            public static void CreateUI()
            {
                var mainlist = SetupList("StudioScene/Canvas Main Menu/04_System");

                CreateMainButton("Load scene param", mainlist, SceneParam.LoadDefaults);
                CreateMainButton("Save scene param", mainlist, () =>
                {
                    SceneParam.Save();
                    SaveToFile();
                });

                var charalist = SetupList("StudioScene/Canvas Main Menu/02_Manipulate/00_Chara/00_Root");

                //CreateCharaButton("Load chara param", charalist, CharacterParam.LoadDefaults);
                CreateCharaButton("Save chara param", charalist, () =>
                {
                    CharacterParam.Save();
                    SaveToFile();
                });
            }
示例#2
0
        private void Awake()
        {
            Logger = base.Logger;
            HarmonyWrapper.PatchAll();

            if (File.Exists(savePath))
            {
                try
                {
                    var json = File.ReadAllText(savePath);
                    data = JSONSerializer.Deserialize <ParamData>(json);
                }
                catch (Exception ex)
                {
                    Logger.Log(LogLevel.Error, $"[DefaultParamEditor] Failed to load settings from {savePath} with error: " + ex);
                    data = new ParamData();
                }
            }

            CharacterParam.Init(data.charaParamData);
            SceneParam.Init(data.sceneParamData);
        }