// Use this for initialization void Awake() { _characterManager = CharacterManager.Instance(); _characterDatabase = CharacterDatabase.Instance(); if (_health == null) { _health = GameObject.FindGameObjectWithTag("Health").GetComponent <BarHandler>(); } if (_mana == null) { _mana = GameObject.FindGameObjectWithTag("Mana").GetComponent <BarHandler>(); } if (_energy == null) { _energy = GameObject.FindGameObjectWithTag("Energy").GetComponent <BarHandler>(); } if (_experience == null) { _experience = GameObject.FindGameObjectWithTag("Experience").GetComponent <BarHandler>(); } if (_coin == null) { _coin = GameObject.FindGameObjectWithTag("Coin").GetComponent <ContainerValueHandler>(); } if (_gem == null) { _gem = GameObject.FindGameObjectWithTag("Gem").GetComponent <ContainerValueHandler>(); } if (_profilePic == null) { _profilePic = GameObject.Find("PlayerPic").GetComponent <Button>(); } if (_characterPic == null) { _characterPic = GameObject.Find("CharacterPic").GetComponent <Button>(); } if (_profileStats == null) { _profileStats = GameObject.Find("ProfileStats"); } if (_characterName == null) { _characterName = GameObject.Find("CharacterName").GetComponent <TextMeshProUGUI>(); } }
// Use this for initialization void Awake() { _characterManager = CharacterManager.Instance(); var combat = GameObject.Find("Combat"); if (combat != null) { _inCombat = true; } if (_health == null) { _health = GameObject.FindGameObjectWithTag("Health").GetComponent <BarHandler>(); } if (_mana == null) { _mana = GameObject.FindGameObjectWithTag("Mana").GetComponent <BarHandler>(); } if (!_inCombat) { if (_energy == null) { _energy = GameObject.FindGameObjectWithTag("Energy").GetComponent <BarHandler>(); } if (_experience == null) { _experience = GameObject.FindGameObjectWithTag("Experience").GetComponent <BarHandler>(); } if (_coin == null) { _coin = GameObject.FindGameObjectWithTag("Coin").GetComponent <ContainerValueHandler>(); } if (_gem == null) { _gem = GameObject.FindGameObjectWithTag("Gem").GetComponent <ContainerValueHandler>(); } } }