protected override void Init() { base.Init(); root.SetActive(false); tutorialDic = new Dictionary <Define.TutorialType, TutorialBase>(); clearTutorial = new Dictionary <Define.TutorialType, bool>(); for (int i = 0, max = tutorialList.Count; i < max; i++) { Define.TutorialType type = tutorialList[i].GetTutorialType(); if (!tutorialDic.ContainsKey(type)) { tutorialDic.Add(type, tutorialList[i]); tutorialList[i].Init(); } } for (int i = 0, max = tutorialUI.Count; i < max; i++) { tutorialUI[i].icon.SetActive(false); } messageBox.Init(); emphasis.Init(); blocker.Init(); finger.Init(); }
public bool IsCleared(Define.TutorialType type) { if (clearTutorial.ContainsKey(type)) { return(clearTutorial[type]); } return(false); }
private TutorialBase GetTutorial(Define.TutorialType type) { if (tutorialDic.ContainsKey(type)) { return(tutorialDic[type]); } return(null); }
public TutorialTable GetTutorial(Define.TutorialType type, int idx) { if (tutorialDic.ContainsKey((int)type)) { if (tutorialDic[(int)type].Count > idx) { return(tutorialDic[(int)type][idx]); } } return(null); }
public void SetTutorialClearData(Define.TutorialType type, bool bClear) { if (!clearTutorial.ContainsKey(type)) { clearTutorial.Add(type, bClear); } else { clearTutorial[type] = bClear; } }
public GameObject GetTutorialUI(Define.TutorialType tutorial, string methodName) { for (int i = 0, max = tutorialUI.Count; i < max; i++) { if (tutorialUI[i].tutorial == tutorial && string.Equals(tutorialUI[i].method, methodName)) { return(tutorialUI[i].icon); } } return(null); }
public void StartTutorial(Define.TutorialType type, int nowCount, System.Action afterEndTutorial) { afterEndTutorialCallback = afterEndTutorial; this.nowCount = nowCount; nowTutorial = type; bReaction = false; root.SetActive(true); blocker.SetAllBlock(true); emphasis.SetAllBlind(true); NextTutorial(); SetTutorialClearData(nowTutorial, true); DataManager.GetInstance().SaveAllData(); }
private string GetConvertedTutorialData() { strBuilder.Length = 0; for (int i = 0; i < TutorialManager.GetInstance().tutorialCount; i++) { Define.TutorialType type = (Define.TutorialType)i; bool bClear = TutorialManager.GetInstance().IsCleared(type); strBuilder.Append(i); strBuilder.Append(dataController.delimiter); strBuilder.Append(ParseBoolToInt(bClear)); if (i < TutorialManager.GetInstance().tutorialCount - 1) { strBuilder.Append(dataController.delimiter); } } return(strBuilder.ToString()); }
public void ShowTutorialUI(Define.TutorialType tutorial, string method) { HideTutorialUI(); if (string.IsNullOrEmpty(method)) { return; } for (int i = 0, max = tutorialUI.Count; i < max; i++) { if (tutorialUI[i].tutorial == tutorial && string.Equals(tutorialUI[i].method, method)) { tutorialUI[i].icon.SetActive(true); nowTutorialUI = tutorialUI[i].icon; return; } } }
private void SetTutorialData(string savedData) { if (string.IsNullOrEmpty(savedData)) { Debug.Log("No Saved Data : TutorialData"); } else { int count = 0; string[] strElement = dataController.GetStringElements(savedData); int size = strElement.Length; while (size > count) { Define.TutorialType type = (Define.TutorialType)TryToParseInt(strElement, count++, 0); bool bClear = TryToParseBool(strElement, count++, false); TutorialManager.GetInstance().SetTutorialClearData(type, bClear); } } }
public void StartTutorial(Define.TutorialType type, System.Action afterEndTutorial) { StartTutorial(type, 0, afterEndTutorial); }