Exemplo n.º 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();
                });
            }
Exemplo n.º 2
0
        private void Awake()
        {
            Log.SetLogSource(Logger);
            Harmony.CreateAndPatchAll(typeof(Hooks));

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

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