예제 #1
0
    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();
    }
예제 #2
0
 public bool IsCleared(Define.TutorialType type)
 {
     if (clearTutorial.ContainsKey(type))
     {
         return(clearTutorial[type]);
     }
     return(false);
 }
예제 #3
0
 private TutorialBase GetTutorial(Define.TutorialType type)
 {
     if (tutorialDic.ContainsKey(type))
     {
         return(tutorialDic[type]);
     }
     return(null);
 }
예제 #4
0
 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);
 }
예제 #5
0
 public void SetTutorialClearData(Define.TutorialType type, bool bClear)
 {
     if (!clearTutorial.ContainsKey(type))
     {
         clearTutorial.Add(type, bClear);
     }
     else
     {
         clearTutorial[type] = bClear;
     }
 }
예제 #6
0
 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);
 }
예제 #7
0
    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();
    }
예제 #8
0
    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());
    }
예제 #9
0
    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;
            }
        }
    }
예제 #10
0
    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);
            }
        }
    }
예제 #11
0
 public void StartTutorial(Define.TutorialType type, System.Action afterEndTutorial)
 {
     StartTutorial(type, 0, afterEndTutorial);
 }