public void InitGuide() { if (PlayerModel.CLEAR_ALL) { PlayerPrefsUtil.RemoveData(PlayerPrefsUtil.GUIDE); guidingItem = null; shield = true; } string GuideInfoStr = PlayerPrefsUtil.GetString(PlayerPrefsUtil.GUIDE); GuideInfo = JsonMapper.ToObject <GuideInfo>(GuideInfoStr); if (GuideInfo == null) { GuideInfo = new GuideInfo(); } if (GuideInfo.completeRoots == null) { GuideInfo.completeRoots = new List <int>(); } if (GuideInfo.completeKeys == null) { GuideInfo.completeKeys = new List <int>(); } GuideRoots = new List <config_guide_item>(); List <config_guide_item> configdata = ResModel.Instance.config_guide.data; for (int i = 0; i < configdata.Count; i++) { config_guide_item item = (config_guide_item)configdata[i]; if (item.id == item.root_id) { GuideRoots.Add(item); if (PlayerModel.CLEAR_ALL) { item.SetCompleteTemp(false); } } } //uiCamera = GameObject.Find("UICamera").GetComponent<Camera>(); }
public void CompleteSave() { config_guide_item nextItem = FindNextItem(guidingItem); if (nextItem == null) { if (!GuideInfo.completeRoots.Contains(guidingItem.root_id)) { if (guidingItem.complete_tip != null && guidingItem.complete_tip != "") { PromptModel.Instance.Pop(LanguageUtil.GetTxt(Convert.ToInt32(guidingItem.complete_tip))); } List <TIVInfo> conditions = guidingItem.GetConditions(); if (conditions != null) { for (int i = 0; i < conditions.Count; i++) { TIVInfo condition = conditions[i]; if (condition.id == (int)GuideIDType.play_map) { guidingItem.SetCompleteTemp(true); return; } } } GuideInfo.completeRoots.Add(guidingItem.root_id); Save(); } } else { } }