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; 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; if (ChooseCharStats.unallocated == 0 && ChooseCharStats.playerName != null) { SceneManager.LoadScene("Town01"); } else { canvasGroup.alpha = 1; } } }