Esempio n. 1
0
        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();
        }
Esempio n. 2
0
    public void HurtUnit(MovingUnit unit)
    {
        if (unit.GetComponent <Player> ())
        {
            CardsManager.Instance.AddCurse();
        }

        unit.GetHurt();

        print(unit.gameObject.name + " was hurt!");
    }
Esempio n. 3
0
 void CatchPickup(MovingUnit unit)
 {
     if (unit.GetComponent <Player> () != null)
     {
         if (gameObject)
         {
             currentTile.onTileEnter -= CatchPickup;
             MapManager.Instance.ArrowToEscape();
             Destroy(gameObject);
         }
     }
 }