コード例 #1
0
    void Update()
    {
        if (lesson_text.Count > 0)
        {
            if (Input.GetKeyDown("right") && index < lesson_text.Count - 1)
            {
                nManager.ClearNodes();
                lesson_text[index].transform.localScale = new Vector3(0, 0, 0);
                index++;
                lesson_text[index].transform.localScale = new Vector3(1, 1, 1);

                if (lesson_text[index].text.Contains("Challenge"))
                {
                    lesson_text[index].transform.localScale = new Vector3(0, 0, 0);
                    vManager.CreateChallenge(lesson_text[index].text.Split(' ')[1]);
                }
                else if (lesson_text[index].text.Contains("Unlock"))
                {
                    lesson_text[index].transform.localScale = new Vector3(0, 0, 0);
                    uManager.Unlock(lesson_text[index].text.Substring(8));
                    index--;
                    lesson_text[index].transform.localScale = new Vector3(1, 1, 1);
                }
            }
            else if (Input.GetKeyDown("left") && index > 0)
            {
                nManager.ClearNodes();
                lesson_text[index].transform.localScale = new Vector3(0, 0, 0);
                index--;
                lesson_text[index].transform.localScale = new Vector3(1, 1, 1);
            }
        }
    }