void Start() { encounterManger = GameObject.FindGameObjectWithTag("EncounterManager").GetComponent <EncounterManger>(); attackButton.onClick.AddListener(OnAttackButton); playerNameText.text = encounterManger.player.name; enemyNameText.text = encounterManger.enemy.name; UpdateLocalHealthValuesToManager(); RefreshHealthSliders(); }
private void Awake() { if (encounterManger != null) { GameObject.Destroy(this.gameObject); } else { encounterManger = this; } DontDestroyOnLoad(this); }