void SetUIData() { ui.buttonCopy.SetOnclik(CopyData); ui.buttonPaste.SetOnclik(PasteData); ui.buttonSave.SetOnclik(SaveData); ui.buttonClear.SetOnclik(ClearData); ui.buttonLocal.SetOnclik(LocalImg); ui.ControlButton.SetOnclik(delegate { if (frame - clickFrame < 10) { ui.UIPostionReast(); } clickFrame = frame; }); SetPageData(); for (int i = 0; i < 7; i++) { int index = i; ui.ButtonDataFile[i].SetOnclik(delegate { SelectData = GetData(index); if (SelectData != null) { AddChangeBuild(SelectData); } isShowImg = true; isLookLocal = false; isAreaSelect = false; AreaTrue(); ui.ChangeRecipe.SetActive(true); }); } ui.ButtonDataUp.SetOnclik(delegate { if (atPage > 0) { atPage--; PageTo(); } }); ui.ButtonDataDown.SetOnclik(delegate { if (atPage < 2100000000) { atPage++; PageTo(); } }); //点击撤销按钮 ui.buttonZ.SetOnclik(delegate { if (GameMain.mainPlayer != null && PastIngData != null) { PastIngData.CancelTask(GameMain.mainPlayer); PastIngData.PasteClear(); } }); ui.SelectBuild.onValueChanged.AddListener(delegate { var name = ui.SelectBuild.options[ui.SelectBuild.value].text; if (BuildName.ContainsKey(name)) { AddChangeRecipe(BuildName[name]); } }); ui.ButtonChangeRecipe.SetOnclik(delegate { var name = ui.SelectBuild.options[ui.SelectBuild.value].text; if (BuildName.ContainsKey(name)) { var recipeName = ui.SelectRecipe.options[ui.SelectRecipe.value].text; if (RecipeName.ContainsKey(recipeName)) { int build = BuildName[name]; int recipe = RecipeName[recipeName]; if (SelectData != null) { SelectData.ChangeRecipe(build, recipe); info = SelectData.Name + "\n" + "修改配方成功"; } } } }); ui.ButtonOpneFile.SetOnclik(delegate { string path = System.Environment.CurrentDirectory + "\\BepInEx\\config\\PlanetFactoryData\\"; System.Diagnostics.Process.Start(path); }); ui.ButtonReLoadFile.SetOnclik(delegate { readFile(); SelectData = null; atPage = 0; PageTo(); }); }