Esempio n. 1
0
 public void Add(Building building)
 {
     if (building.hasAuthority && building.playerId == playerId)
     {
         FriendlyBuildings.Add(building);
     }
     else
     {
         EnemyBuildings.Add(building);
     }
 }
Esempio n. 2
0
        void OnEntityFound(System.Object obj)
        {
            IGameEntity g = ((GameObject)obj).GetComponent <IGameEntity>();

            if (g.info.isUnit)
            {
                if (!EnemyUnits.Contains((Unit)g))
                {
                    g.registerFatalWounds(OnEnemyDied);
                    EnemyUnits.Add((Unit)g);
                }
            }
            else if (g.info.isBuilding)
            {
                if (!EnemyBuildings.Contains(g))
                {
                    g.registerFatalWounds(OnEnemyDied);
                    EnemyBuildings.Add(g);
                }
            }
        }