Пример #1
0
    void Start()
    {
        // チュートリアル表示用UIのインスタンス取得
        tutorialTextArea = GameObject.Find("TextBoard").GetComponent <RectTransform>();
        TutorialTitle    = tutorialTextArea.Find("Title").GetComponent <Text>();
        TutorialText     = tutorialTextArea.Find("Text").GetComponentInChildren <Text>();
        NextButton       = GameObject.Find("Next");
        BackButton       = GameObject.Find("Back");

        // チュートリアルの一覧
        tutorialTask = new List <ITutorialTask>()
        {
            new InitTask(),
            new SceneTask1(),
            new SceneTask2(),
            new GameTask1(),
            new GameTask2(),
            new GameTask3(),
            new GameTask4(),
            new GameTask4_2(),
            new DropTask1(),
            new DropTask1_2(),
            new ClearTask(),
            new FinishTask(),
        };

        currentTask = tutorialTask.First();

        // 最初のチュートリアルを設定
        StartCoroutine(SetCurrentTask(currentTask));

        isEnabled = true;
    }
Пример #2
0
    void Start()
    {
        // チュートリアル表示用UIのインスタンス取得
        tutorialTextArea = GameObject.Find("TextBoard").GetComponent <RectTransform>();
        TutorialTitle    = tutorialTextArea.Find("Title").GetComponent <Text>();
        TutorialText     = tutorialTextArea.Find("Text").GetComponentInChildren <Text>();
        NextButton       = GameObject.Find("Next");
        BackButton       = GameObject.Find("Back");
        audio            = GetComponent <AudioSource>();


        // チュートリアルの一覧
        tutorialTask = new List <ITutorialTask>()
        {
            new FirstTask(),
            new DragTask(),
            new DropTask(),
            new OperationTask(),
            new SushiTask(),
            new SushiTask2(),
            new RepoTask(),
            new EventTask(),
            new ShuffleTask(),
            new FinishTask(),
        };

        currentTask = tutorialTask.First();

        // 最初のチュートリアルを設定
        StartCoroutine(SetCurrentTask(currentTask));
    }
Пример #3
0
    /// 新しいチュートリアルタスクを設定する

    protected IEnumerator SetCurrentTask(ITutorialTask task, float time = 0)
    {
        // timeが指定されている場合は待機
        yield return(new WaitForSeconds(time));

        currentTask = task;

        // UIにタイトルと説明文を設定
        TutorialTitle.text = task.GetTitle();
        TutorialText.text  = task.GetText();

        //ボタンの表示を設定
        NextButton.SetActive(task.GetNextButton());
        BackButton.SetActive(task.GetBackButton());

        // チュートリアルタスク設定時用の関数を実行
        task.OnTaskSetting();
    }