void HandleUnitDied(object sender, EventArgs args) { UnitDiedEvent e = args as UnitDiedEvent; BUnit bUnit = GetBUnit(e.unit); bCameraMover.Focus(bUnit.transform.position); bUnit.Died(); }
protected virtual void Awake() { unitDied = new UnitDiedEvent(); dealtDamageEvent = new DealtDamageEvent(); health = GetComponent <Health>(); debuffs = GetComponent <Debuffs>(); currentSpeed = baseSpeed; }
private void OnUnitDied(UnitDiedEvent customEvent) { UnitStackBase unit = customEvent.Unit; if (playerUnitsInBattle.Contains(unit)) { playerUnitsInBattle.Remove(unit); } else if (enemyUnitsInBattle.Contains(unit)) { enemyUnitsInBattle.Remove(unit); } else { return; } unit.gameObject.SetActive(false); deadUnits.Add(unit); battleUI.DeselectCurrentTarget(); }