void FreshLevelBtn(ChapterStruct chapterData){ //may change to array var normalSetting = (ChatperLevelBtnScript)btnNormal.GetComponent(typeof(ChatperLevelBtnScript)); normalSetting.FreshUI(chapterData); var mareSetting = (ChatperLevelBtnScript)btnNightMare.GetComponent(typeof(ChatperLevelBtnScript)); mareSetting.FreshUI(chapterData); }
public void FreshUI(ChapterStruct data){ if(data.Level == level){ tSelected.gameObject.SetActive(true); tLocked.gameObject.SetActive(false); return; } tSelected.gameObject.SetActive(false); tLocked.gameObject.SetActive(!data.UnLocked((int)level)); }
public void BindingData(ChapterStruct newData){ if(this.chapterData == null){ this.chapterData = newData; RegistAction(); return; } UnRegistAction(); this.chapterData = newData; RegistAction(); }
public void BindingData(ChapterStruct chapter){ if(this.chapter == null){ this.chapter = chapter; ResetData(); RegistAction(); return; } UnRegistAction(); this.chapter = chapter; ResetData(); RegistAction(); }
ChapterStruct LoadChapter(int chapterId){ ChapterStruct chapterStruct = new ChapterStruct(chapterId); chapterDic.Add(chapterId , chapterStruct); return chapterStruct; }