Beispiel #1
0
 public void SpawnEnemies(int numberToSpawn)
 {
     for (int enemy = 0; enemy < numberToSpawn; enemy++)
     {
         EnemySpawnPoints randomSpawPoints = enemySpawnPoints[Random.Range(0, enemySpawnPoints.Count)];
         randomSpawPoints.SpawnRandomEnemy();
     }
 }
 public void SpawnEnemies(int numberToSpawn)
 {
     for (int enemy = 0; enemy < numberToSpawn; enemy++)
     {
         EnemySpawnPoints randomSpawnPoint = enemySpawnPoints[UnityEngine.Random.Range(0, enemySpawnPoints.Count)];
         //randomSpawnPoint.SpawnRandomEnemy();
         randomSpawnPoint.SpawnEnemy(enemy);
     }
 }
Beispiel #3
0
        private void GameObject_OnDelete(GameObject sender, EventArgs args)
        {
            AllObjects.Remove(sender);

            var hero = sender as AIHeroClient;

            if (hero != null)
            {
                AllHeroes.Remove(hero);
                if (hero.IsEnemy)
                {
                    EnemyHeroes.Remove(hero);
                    AllEnemies.Remove(hero);
                }
                else
                {
                    AllyHeroes.Remove(hero);
                    AllAllies.Remove(hero);
                }

                return;
            }

            var minion = sender as Obj_AI_Minion;

            if (minion != null)
            {
                if (minion.Team != GameObjectTeam.Neutral)
                {
                    if (minion.GetMinionType().HasFlag(Extensions.MinionTypes.Ward))
                    {
                        AllWards.Remove(minion);
                        if (minion.IsEnemy)
                        {
                            EnemyWards.Remove(minion);
                        }
                        else
                        {
                            AllyWards.Remove(minion);
                        }
                    }
                    else
                    {
                        AllMinions.Remove(minion);
                        if (minion.IsEnemy)
                        {
                            EnemyMinions.Remove(minion);
                            AllEnemies.Remove(minion);
                        }
                        else
                        {
                            AllyMinions.Remove(minion);
                            AllAllies.Remove(minion);
                        }
                    }
                }
                else if (minion.Name != "WardCorpse")
                {
                    switch (minion.GetJungleType())
                    {
                    case Extensions.JungleType.Small:
                        SmallJungleMinions.Remove(minion);
                        break;

                    case Extensions.JungleType.Large:
                        LargeJungleMinions.Remove(minion);
                        break;

                    case Extensions.JungleType.Epic:
                        EpicJungleMinions.Remove(minion);
                        break;

                    case Extensions.JungleType.Legendary:
                        LegendaryJungleMinions.Remove(minion);
                        break;
                    }

                    AllJungleMinions.Remove(minion);
                }

                return;
            }

            var particle = sender as Obj_GeneralParticleEmitter;

            if (particle != null)
            {
                AllParticleEmitters.Remove(particle);
                return;
            }

            var turret = sender as Obj_AI_Turret;

            if (turret != null)
            {
                AllTurrets.Remove(turret);

                if (turret.IsEnemy)
                {
                    EnemyTurrets.Remove(turret);
                }
                else
                {
                    AllyTurrets.Remove(turret);
                }

                return;
            }

            var shop = sender as Obj_Shop;

            if (shop != null)
            {
                AllShops.Remove(shop);

                if (shop.IsAlly)
                {
                    AllyShops.Remove(shop);
                }
                else
                {
                    EnemyShops.Remove(shop);
                }

                return;
            }

            var spawnPoint = sender as Obj_SpawnPoint;

            if (spawnPoint != null)
            {
                AllSpawnPoints.Remove(spawnPoint);

                if (spawnPoint.IsAlly)
                {
                    AllySpawnPoints.Remove(spawnPoint);
                }
                else
                {
                    EnemySpawnPoints.Remove(spawnPoint);
                }
            }

            var inhibitor = sender as Obj_BarracksDampener;

            if (inhibitor != null)
            {
                AllInhibitors.Remove(inhibitor);

                if (inhibitor.IsAlly)
                {
                    AllyInhibitors.Remove(inhibitor);
                }
                else
                {
                    EnemyInhibitors.Remove(inhibitor);
                }
            }

            var nexus = sender as Obj_HQ;

            if (nexus != null)
            {
                AllNexus.Remove(nexus);

                if (nexus.IsAlly)
                {
                    AllyNexus = null;
                }
                else
                {
                    EnemyNexus = null;
                }
            }

            var missile = sender as MissileClient;

            if (missile != null)
            {
                AllMissiles.Remove(missile);

                if (missile.IsAlly)
                {
                    AllyMissiles.Remove(missile);
                }
                else
                {
                    EnemyMissiles.Remove(missile);
                }
            }
        }