Exemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     lines          = txt.text.Split('\n');
     lineInd        = 0;
     isStartShowEnd = false;
     teachState     = TeachState.NotTeaching;
     StartCoroutine(startShow(lines[lineInd++]));
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        blockController[] Controllers = pickupBoard.GetComponentsInChildren <blockController>();
        foreach (var controller in Controllers)
        {
            if (controller.type == blockType.mouse)
            {
                mouseController = controller;
            }
        }
        switch (teachState)
        {
        case TeachState.NotTeaching:
            if (Input.anyKeyDown && isStartShowEnd)
            {
                if (lineInd != lines.Length)
                {
                    ShowLines(lines[lineInd++]);
                }
                else
                {
                    isEnd = true;
                    panel.SetActive(false);
                }
            }
            break;

        case TeachState.TeachingCatScareMouse:
            if (mouseController.isChanged)
            {
                teachState = TeachState.NotTeaching;
                panel.SetActive(true);
                if (lineInd != lines.Length)
                {
                    ShowLines(lines[lineInd++]);
                }
                else
                {
                    isEnd = true;
                    panel.SetActive(false);
                }
            }
            break;

        case TeachState.TeachingMouseAvoidCat:
            if (mouseController.isAtJigsawBoard)
            {
                teachState = TeachState.NotTeaching;
                panel.SetActive(true);
                if (lineInd != lines.Length)
                {
                    ShowLines(lines[lineInd++]);
                }
                else
                {
                    isEnd = true;
                    panel.SetActive(false);
                }
            }
            break;

        default:
            break;
        }
    }
Exemplo n.º 3
0
 void Teach(TeachState state)
 {
     teachState = state;
     panel.SetActive(false);
 }