Ejemplo n.º 1
0
    public IEnumerator coroutineSayAll()
    {
        m_state = TutoState.Talking;

        foreach (string message in textsToSay)
        {
            textField.setMessage(message);
            textField.resetText();
            textField.startTyping();

            while (!textField.isComplete())
            {
                yield return(null);
            }

            // wait before displaying next message
            m_state = TutoState.Waiting;
            //yield return new WaitForSeconds(0.1f);
            while (m_state == TutoState.Waiting)
            {
                yield return(null);
            }
        }

        m_state = TutoState.Finish;
        if (dialogueEndCallback != null)
        {
            dialogueEndCallback();
        }
        else
        {
            getOut();
        }
    }
Ejemplo n.º 2
0
    public IEnumerator coroutineSayAll()
    {
        m_state = TutoState.Talking;

        foreach(string message in textsToSay) {
            textField.setMessage(message);
            textField.resetText();
            textField.startTyping();

            while(!textField.isComplete())
                yield return null;

            // wait before displaying next message
            m_state = TutoState.Waiting;
            //yield return new WaitForSeconds(0.1f);
            while(m_state == TutoState.Waiting)
                yield return null;
        }

        m_state = TutoState.Finish;
        if(dialogueEndCallback != null)
            dialogueEndCallback();
        else
            getOut();
    }
Ejemplo n.º 3
0
    private IEnumerator waitForOut()
    {
        yield return(new WaitForSeconds(1.7f));

        m_state = TutoState.Hidden;
        if (outCallback != null)
        {
            outCallback();
        }
    }
Ejemplo n.º 4
0
    private IEnumerator waitForReady()
    {
        yield return(new WaitForSeconds(1.7f));

        m_state = TutoState.Ready;
        if (readyCallback != null)
        {
            readyCallback();
        }
    }
Ejemplo n.º 5
0
 // Update is called once per frame
 void Update()
 {
     if ((m_state == TutoState.Talking || m_state == TutoState.Waiting) &&
         Input.GetButtonDown("Fire1"))
     {
         if (m_state == TutoState.Talking)
         {
             // instant display of the rest of the current message (coroutine handle that!)
             textField.instantDisplay();
         }
         else
         {
             m_state = TutoState.Talking;
         }
     }
 }
Ejemplo n.º 6
0
 private void setTutoState(TutoState state)
 {
     this.tutoState = state;
 }
Ejemplo n.º 7
0
    private IEnumerator waitForReady()
    {
        yield return new WaitForSeconds(1.7f);

        m_state = TutoState.Ready;
        if(readyCallback != null)
            readyCallback();
    }
Ejemplo n.º 8
0
 private IEnumerator waitForOut()
 {
     yield return new WaitForSeconds(1.7f);
     m_state = TutoState.Hidden;
     if(outCallback != null)
         outCallback();
 }
Ejemplo n.º 9
0
 // Update is called once per frame
 void Update()
 {
     if( (m_state == TutoState.Talking || m_state == TutoState.Waiting)
        && Input.GetButtonDown("Fire1"))
     {
         if(m_state == TutoState.Talking) {
             // instant display of the rest of the current message (coroutine handle that!)
             textField.instantDisplay();
         }
         else {
             m_state = TutoState.Talking;
         }
     }
 }
Ejemplo n.º 10
0
    public void TutoPass()
    {
        if (counter >= 6)
        {
            MenuController.blockPause = false;
            SceneManager.LoadScene(1);
        }

        m_tuto = (TutoState)counter;

        text[0].SetActive(false);

        switch (m_tuto)
        {
        case TutoState.pointLife:
            for (int i = 0; i < arrows.Count; i++)
            {
                arrows[i].SetActive(false);
                text[i].SetActive(false);
                arrows[0].SetActive(true);
                text[1].SetActive(true);
            }
            break;

        case TutoState.pointFood:
            for (int i = 0; i < arrows.Count; i++)
            {
                arrows[i].SetActive(false);
                text[i].SetActive(false);
                arrows[1].SetActive(true);
                text[2].SetActive(true);
            }
            break;

        case TutoState.pointPause:
            for (int i = 0; i < arrows.Count; i++)
            {
                arrows[i].SetActive(false);
                text[i].SetActive(false);
                arrows[2].SetActive(true);
                text[3].SetActive(true);
            }
            break;

        case TutoState.pointJoystick:
            for (int i = 0; i < arrows.Count; i++)
            {
                arrows[i].SetActive(false);
                text[i].SetActive(false);
                arrows[3].SetActive(true);
                text[4].SetActive(true);
            }
            break;

        case TutoState.pointShotB:
            for (int i = 0; i < arrows.Count; i++)
            {
                arrows[i].SetActive(false);
                text[i].SetActive(false);
                arrows[4].SetActive(true);
                text[5].SetActive(true);
            }
            break;

        case TutoState.pointAbilityB:
            for (int i = 0; i < arrows.Count; i++)
            {
                arrows[i].SetActive(false);
                text[i].SetActive(false);
                arrows[5].SetActive(true);
                text[6].SetActive(true);
            }
            break;

        default:
            break;
        }

        counter++;
    }