Exemple #1
0
    public void EndBattle(bool win, int exp)
    {
        transitionUI.SetActive(false);
        transitionUI.SetActive(true);
        AudioScript audioScript = new AudioScript();

        StartCoroutine(audioScript.FadeOut(battleAudio, 0.3f));
        StartCoroutine(audioScript.FadeIn(exploreAudio, 0.3f));
        battleTransition.SetActive(false);
        battleSystem.gameObject.SetActive(false);
        mainCamera.gameObject.SetActive(true);
        state = GameState.FreeRoam;
        if (win)
        {
            //TODO: SHOW EXP PROGRESS

            PlayerStat.exp += exp;

            if (PlayerStat.exp >= PlayerStat.maxExp)
            {
                state = GameState.Status;
                LevelUp();
                PlayerStat.maxExp += 15;
                PlayerStat.exp     = 0;
                OpenStat();
            }
        }
        else
        {
            //Game Over
            gameOverPanel.SetActive(true);
            state = GameState.GameOver;
        }
    }
    public IEnumerator StartTransition()
    {
        StartCoroutine(audioScript.FadeOut(exploreAudio, 0.3f));
        StartCoroutine(audioScript.FadeIn(battleAudio, 0.3f));

        blit.enabled = true;
        if (!transitionState)
        {
            transition.fadeState = "out";
            transitionState      = true;
        }
        else
        {
            transition.fadeState = "in";
            transitionState      = false;
        }


        yield return(new WaitForSeconds(2.2f));

        blit.enabled = false;
    }
Exemple #3
0
    private void Start()
    {
        playerMove.onEncounter         += StartBattle; // manggil fungsi StartBattle kalo onEncounter kepanggil
        battleSystem.onBattleOver      += EndBattle;
        playerMove.onDialogue          += StartDialogue;
        dialogueTrigger.onDialogueOver += EndDialogue;


        StartCoroutine(audioScript.FadeIn(exploreAudio, 0.5f));
        battleTransition.SetActive(false);
        state = GameState.Dialogue;
        StartCoroutine(FirstDialogue());
    }
Exemple #4
0
 private void Start()
 {
     audioScript.FadeIn(audioSource, 0.3f);
     StartCoroutine(StartDialogue());
 }