Skip to content
Snippets Groups Projects
DoneButton.cs 1017 B
Newer Older
Michael LaFreniere's avatar
Michael LaFreniere committed
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class DoneButton : MonoBehaviour {

    private PlayerStats stats;
    private CanvasGroup canvasGroup;

    // Use this for initialization
    void Start () {
        ArenaCombatControl.winCount = 0; // reset win and money to 0 after game over/quit to main menu
        Money.coins = 0;
Michael LaFreniere's avatar
Michael LaFreniere committed
        stats = GameObject.Find("CharacterDisplay").GetComponent<PlayerStats>();
        canvasGroup = GameObject.Find("errorMessage").GetComponent<CanvasGroup>();
    }
	
	// Update is called once per frame
	void Update () {
	
	}

    public void OnClickDone() {
        stats.heal(); // spawn with full health - necessary after player portrait implementation
        Money.coins = PlayerStats.luck * 2;
Michael LaFreniere's avatar
Michael LaFreniere committed
        if (ChooseCharStats.unallocated == 0 && ChooseCharStats.playerName != null) {
            SceneManager.LoadScene("Town01");

        }
        else {
            canvasGroup.alpha = 1;
        }
    }
}