public void NotifyDeath(MovingUnit go) { if (go.faction == Faction.PLAYER) { alivePlayerUnitsLock.AcquireWriterLock(500); alivePlayerUnits.Remove(go.GetComponent <Unit>()); alivePlayerUnitsLock.ReleaseWriterLock(); } else { aliveEnemyUnitsLock.AcquireWriterLock(500); aliveEnemyUnits.Remove(go.GetComponent <Unit>()); aliveEnemyUnitsLock.ReleaseWriterLock(); } battleUIController.RefreshArmyBarsUI(alivePlayerUnits.Count, allPlayerUnitsCount, aliveEnemyUnits.Count, allEnemyUnitsCount); CheckWinLoseConditions(); }
public void HurtUnit(MovingUnit unit) { if (unit.GetComponent <Player> ()) { CardsManager.Instance.AddCurse(); } unit.GetHurt(); print(unit.gameObject.name + " was hurt!"); }
void CatchPickup(MovingUnit unit) { if (unit.GetComponent <Player> () != null) { if (gameObject) { currentTile.onTileEnter -= CatchPickup; MapManager.Instance.ArrowToEscape(); Destroy(gameObject); } } }