/// <summary> /// 保存游戏数据 /// </summary> /// <param name="data"></param> public void SetBiomeInfoData(BiomeInfoBean data) { serviceBiomeInfo.UpdateData(data); }
/// <summary> /// 生态展示UI /// </summary> /// <param name="isCreate"></param> /// <param name="biomeInfo"></param> protected void UIForBiomeItem(bool isCreate, BiomeInfoBean biomeInfo) { if (biomeInfo == null) { return; } GUILayout.BeginHorizontal(); if (isCreate) { if (EditorUI.GUIButton("创建生态", 150)) { biomeInfo.link_id = biomeInfo.id; biomeInfo.valid = 1; bool isSuccess = serviceForBiomeInfo.UpdateData(biomeInfo); if (!isSuccess) { LogUtil.LogError("创建失败"); } } } else { if (EditorUI.GUIButton("更新生态", 150)) { biomeInfo.link_id = biomeInfo.id; bool isSuccess = serviceForBiomeInfo.UpdateData(biomeInfo); if (!isSuccess) { LogUtil.LogError("更新失败"); } } if (EditorUI.GUIButton("删除生态", 150)) { bool isSuccess = serviceForBiomeInfo.DeleteData(biomeInfo.id); if (isSuccess) { listQueryData.Remove(biomeInfo); } else { LogUtil.LogError("删除失败"); } } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); EditorUI.GUIText("生态Id", 50); biomeInfo.id = EditorUI.GUIEditorText(biomeInfo.id); EditorUI.GUIText("名字", 50); biomeInfo.name_cn = EditorUI.GUIEditorText(biomeInfo.name_cn); biomeInfo.name_en = EditorUI.GUIEditorText(biomeInfo.name_en); biomeInfo.id = (int)EditorUI.GUIEnum <BiomeTypeEnum>("生态类型:", (int)biomeInfo.id); EditorUI.GUIText("频率", 50); biomeInfo.frequency = EditorUI.GUIEditorText(biomeInfo.frequency); EditorUI.GUIText("振幅", 50); biomeInfo.amplitude = EditorUI.GUIEditorText(biomeInfo.amplitude); EditorUI.GUIText("最小高度(默认50)", 150); biomeInfo.min_height = EditorUI.GUIEditorText(biomeInfo.min_height); EditorUI.GUIText("大小", 50); biomeInfo.scale = EditorUI.GUIEditorText(biomeInfo.scale); GUILayout.EndHorizontal(); }