private void RetrieveOrCreatedInGameUI() { if (!GameObject.FindGameObjectWithTag(inGameUIPrefab.tag)) { Debug.Log("Info: Create InGameUI in the hierarchy"); _currentInGameUI = Instantiate(inGameUIPrefab); } else { _currentInGameUI = GameObject.FindGameObjectWithTag(inGameUIPrefab.tag); } _InGameUIScript = _currentInGameUI.GetComponent <ManagerUI_HUD>(); }
void Awake() { instance = this; //playerController = GameObject.FindGameObjectWithTag("Player"); playerController.OnDamage.AddListener(healthBar.SetCurrentValue); }