public void initData() { using (var stream = new MemoryStream(storyRel.bytes)) { StoryRelationTab._instance().Load(stream); } using (var stream = new MemoryStream(storyBgSceneRel.bytes)) { StoryBgSceneRelationTab._instance().Load(stream); } using (var stream = new MemoryStream(bgScenePic.bytes)) { bgScenePicTab._instance().Load(stream); } using (var stream = new MemoryStream(roleFacePic.bytes)) { roleFacePicTab._instance().Load(stream); } using (var stream = new MemoryStream(talkOption.bytes)) { talkOptionTab._instance().Load(stream); } }
public static StoryRelationTab _instance() { if (instance == null) { instance = new StoryRelationTab(); instance.initParam(); } return(instance); }
public void UIAddID() { int tmpID = StoryRelationTab._instance().getNewID(); textID.text = tmpID.ToString(); textNextID.text = "0"; uiEffect.value = 0; roleSay.value = 0; BgChange.value = 0; isAutoSave.value = 0; isKeyOption.value = 0; textCn.text = "Need input"; textEn.text = "Need input"; }
//UI调用 public void UISelID() { int tempID = int.Parse(textID.text.Trim()); CSVRow tmpRow = StoryRelationTab._instance().GetRowFromID(tempID); if (tmpRow != null) { textNextID.text = tmpRow.GetString(StoryRelationTab.csNextID); uiEffect.value = tmpRow.GetInt(StoryRelationTab.csUISort); roleSay.value = tmpRow.GetInt(StoryRelationTab.csIsRoleSay); BgChange.value = tmpRow.GetInt(StoryRelationTab.csNeedChangeBg); isAutoSave.value = tmpRow.GetInt(StoryRelationTab.csIsAutoSave); isKeyOption.value = tmpRow.GetInt(StoryRelationTab.csIsKeySave); textCn.text = tmpRow.GetString(StoryRelationTab.csContentCN); textEn.text = tmpRow.GetString(StoryRelationTab.csContentEn); } }
public void UICheckNextID() { int tempNextID = int.Parse(textNextID.text.Trim()); CSVRow tmpRow = StoryRelationTab._instance().GetRowFromID(tempNextID); if (tmpRow != null) { //nextID检测通过 checkNextIDObj.text = csNextIDExist; checkNextIDObj.color = new Color(0, 0, 0); } else { checkNextIDObj.text = csNextIDNotExist; checkNextIDObj.color = new Color(255, 0, 0); } checkNextIDObj.gameObject.SetActive(true); }
//显示剧情内容 public void showContentText(int nowStoryid) { storyID = nextStoryID; CSVRow tmpRow = StoryRelationTab._instance().GetRowFromID(nowStoryid); string msg = tmpRow.GetString(StoryRelationTab.csContentCN); ContentText.text = stringReplace(msg); //是否自动保存 int isAutoSave = tmpRow.GetInt(StoryRelationTab.csIsAutoSave); if (isAutoSave == 1) { autoSaveData.instance().saveData(storyID); } nextStoryID = tmpRow.GetInt(StoryRelationTab.csNextID); if (nextStoryID == 0) //出现选项的剧情 { showTalkSel(nowStoryid); } int tmpIsRoleSay = tmpRow.GetInt(StoryRelationTab.csIsRoleSay); if (tmpIsRoleSay == 1) //角色说的话 { //判断角色是否发生改变 } else //背景傍白 //角色头像是否要隐蔽 { } int tmpIsChangeBgScene = tmpRow.GetInt(StoryRelationTab.csNeedChangeBg); if (tmpIsChangeBgScene == 1) //场景需要切换 { showBgScene(nowStoryid); } }