예제 #1
0
        /// <summary>
        /// (Cross-Game compatible) Get every Tower that has been created through the Tower Factory
        /// </summary>
        /// <param name="inGame"></param>
        /// <param name="name">Optionally only get Towers whose TowerModel name is this paramater</param>
        /// <returns></returns>
        public static List <Tower> GetTowers(this InGame inGame, string name = null)
        {
            var towers = inGame.GetAllObjectsOfType <Tower>();

            if (!string.IsNullOrEmpty(name))
            {
                towers = towers?.FindAll(tower => tower.towerModel.name == name);
            }

            return(towers);
        }
예제 #2
0
 /// <summary>
 /// (Cross-Game compatible) Get's all existing Projectiles on the map
 /// </summary>
 /// <param name="inGame"></param>
 /// <returns></returns>
 public static List <Projectile> GetProjectiles(this InGame inGame)
 {
     return(inGame.GetAllObjectsOfType <Projectile>());
 }