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