private void HandleEnemy() { if (_enemyInReach == null && !_equippedEnemy) { return; } if (!_equippedEnemy) { _enemyInReach.Disable(); _equippedEnemy = true; _enemyInReach = null; _enemyEquipPosition.gameObject.SetActive(true); } else { if (_pyreInReach != null) { _enemyEquipPosition.gameObject.SetActive(false); _equippedEnemy = false; _pyreInReach.AddFuel(); _pyreInReach = null; } } }
private void OnTriggerStay2D(Collider2D other) { if (_equippedEnemy) { if (_pyreInReach == null) { if (other.CompareTag("Pyre")) { _pyreInReach = other.GetComponent <Pyre>(); } } } else { if (_enemyInReach == null) { if (other.CompareTag("Enemy")) { _enemyInReach = other.transform.GetComponentInParent <Enemy>(); } } } }