Example #1
0
    void HandleStandaloneUpdate()
    {
        if (Input.GetMouseButtonDown(0))
        {
            switch (state)
            {
            case DIALOGUE_STATE.NONE:
                break;

            case DIALOGUE_STATE.TWEENING:
                dialogue_text.DOComplete();
                state = DIALOGUE_STATE.ENDED;
                break;

            case DIALOGUE_STATE.ENDED:
                if (!GameManager.instance.situations_manager.IsNextStepSelection())
                {
                    EndDialogue();
                }
                else
                {
                    GameManager.instance.situations_manager.OnStepFinish();
                    state = DIALOGUE_STATE.NONE;
                    GameManager.instance.audio_source.Stop();
                }
                break;

            default:
                break;
            }
        }
    }
Example #2
0
    void HandlePhoneUpdate()
    {
        if (Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Ended)
        {
            switch (state)
            {
            case DIALOGUE_STATE.NONE:
                break;

            case DIALOGUE_STATE.TWEENING:
                dialogue_text.DOComplete();
                state = DIALOGUE_STATE.ENDED;
                break;

            case DIALOGUE_STATE.ENDED:
                if (!GameManager.instance.situations_manager.IsNextStepSelection())
                {
                    EndDialogue();
                }
                else
                {
                    GameManager.instance.situations_manager.OnStepFinish();
                    state = DIALOGUE_STATE.NONE;
                    GameManager.instance.audio_source.Stop();
                }
                break;

            default:
                break;
            }
        }
    }
Example #3
0
    void SetDialogueText(string text, float d_speed)
    {
        float speed = text.Length / d_speed;

        if (text.Contains("[anger]"))
        {
            dialogue.transform.DOShakePosition(speed, 1, 40, 0, false, false);
            text = text.Replace("[anger]", "");
        }

        dialogue_text.text = "";
        dialogue_text.DOText(text, speed).OnComplete(EndedTextTween).SetEase(Ease.Linear);

        state = DIALOGUE_STATE.TWEENING;
    }
Example #4
0
    public void EndDialogue()
    {
        if (player_name.activeSelf)
        {
            player_name.SetActive(false);
        }
        else if (npc_name.activeSelf)
        {
            npc_name.SetActive(false);
        }

        dialogue.SetActive(false);
        RemoveModelPrefabs();

        state = DIALOGUE_STATE.NONE;

        GameManager.instance.ui_opened = false;
        GameManager.instance.situations_manager.OnStepFinish();
    }
Example #5
0
 void EndedTextTween()
 {
     state = DIALOGUE_STATE.ENDED;
 }