Skip to Main Content
Table of Contents

BTD_Mod_Helper​.Extensions​.GameModelExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

GameModelExt Class

Extensions for the GameModel

public static class GameModelExt

Inheritance System.Object  GameModelExt

Methods

GameModelExt.AddHeroDetails(this GameModel, HeroDetailsModel, int) Method

Adds a HeroDetailsModel to the GameModel's HeroSet at a particular index

public static void AddHeroDetails(this GameModel model, HeroDetailsModel heroDetailsModel, int index);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

heroDetailsModel Il2CppAssets.Scripts.Models.TowerSets.HeroDetailsModel

index System.Int32

GameModelExt.AddTowerDetails(this GameModel, TowerDetailsModel, int) Method

Adds a TowerDetailsModel to the GameModel's TowerSet at a particular index

public static void AddTowerDetails(this GameModel model, TowerDetailsModel towerDetailsModel, int index);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerDetailsModel Il2CppAssets.Scripts.Models.TowerSets.TowerDetailsModel

index System.Int32

GameModelExt.AddTowerDetails(this GameModel, TowerDetailsModel, TowerSet) Method

Adds a TowerDetailsModel to the GameModel's TowerSet, taking into account what set of towers it's a part of


For example, a new custom Primary tower would be added right at the end of the primary towers,
and right before the start of the military towers

public static void AddTowerDetails(this GameModel model, TowerDetailsModel towerDetailsModel, TowerSet set);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

The GameModel

towerDetailsModel Il2CppAssets.Scripts.Models.TowerSets.TowerDetailsModel

The TowerDetailsModel to be added

set Il2CppAssets.Scripts.Models.TowerSets.TowerSet

The TowerSet of the tower to be added

GameModelExt.AddTowerDetails(this GameModel, TowerDetailsModel) Method

Adds a tower

public static void AddTowerDetails(this GameModel model, TowerDetailsModel towerDetailsModel);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerDetailsModel Il2CppAssets.Scripts.Models.TowerSets.TowerDetailsModel

GameModelExt.AddTowersToGame(this GameModel, IEnumerable) Method

Add multiple TowerModels to the game more efficiently than calling the single method repeatedly.

public static void AddTowersToGame(this GameModel model, System.Collections.Generic.IEnumerable<TowerModel> towerModels);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerModels System.Collections.Generic.IEnumerable<Il2CppAssets.Scripts.Models.Towers.TowerModel>

GameModelExt.AddTowerToGame(this GameModel, TowerModel, TowerDetailsModel) Method

Add a TowerModel to the game.


Using this method is preferable than modifying the GameModel's towers list manually, as this does more things
to more fully integrate the tower within the game

public static void AddTowerToGame(this GameModel model, TowerModel towerModel, TowerDetailsModel towerDetailsModel=null);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

the GameModel instance

towerModel Il2CppAssets.Scripts.Models.Towers.TowerModel

TowerModel to add

towerDetailsModel Il2CppAssets.Scripts.Models.TowerSets.TowerDetailsModel

Optionally add a TowerDetailsModel for your towerModel

GameModelExt.AddUpgrade(this GameModel, UpgradeModel) Method

Fully adds an UpgradeModel to the GameModel

public static void AddUpgrade(this GameModel model, UpgradeModel upgradeModel);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

upgradeModel Il2CppAssets.Scripts.Models.Towers.Upgrades.UpgradeModel

GameModelExt.AddUpgrades(this GameModel, List) Method

Fully adds multiple UpgradeModels to the GameModel

public static void AddUpgrades(this GameModel model, System.Collections.Generic.List<UpgradeModel> upgradeModels);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

upgradeModels System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.Upgrades.UpgradeModel>

GameModelExt.AddUpgrades(this GameModel, UpgradeModel[]) Method

Fully adds multiple UpgradeModels to the GameModel

public static void AddUpgrades(this GameModel model, UpgradeModel[] upgradeModels);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

upgradeModels Il2CppAssets.Scripts.Models.Towers.Upgrades.UpgradeModel[]

GameModelExt.CreateBloonEmission(this GameModel, string, float) Method

Create a single BloonEmission

public static BloonEmissionModel CreateBloonEmission(this GameModel model, string bloonName, float time);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

the GameModel instance

bloonName System.String

Name of this bloon. Example: "Red"

time System.Single

Time the bloon should be spawned

Returns

Il2CppAssets.Scripts.Models.Rounds.BloonEmissionModel

GameModelExt.CreateBloonEmissions(this GameModel, BloonModel, int, float) Method

Create a BloonEmissionModel from a bloonModel

public static Il2CppReferenceArray<BloonEmissionModel> CreateBloonEmissions(this GameModel model, BloonModel bloonModel, int number, float spacing);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

the GameModel instance

bloonModel Il2CppAssets.Scripts.Models.Bloons.BloonModel

The bloon model that these bloons should be

number System.Int32

Number of Bloons in this emission

spacing System.Single

Space between each bloon in this emission

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

GameModelExt.CreateBloonEmissions(this GameModel, string, int, float) Method

Create a BloonEmissionModel from a bloon's name

public static Il2CppReferenceArray<BloonEmissionModel> CreateBloonEmissions(this GameModel model, string bloonName, int number, float spacing);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

the GameModel instance

bloonName System.String

Name of bloon. Example: "Red"

number System.Int32

Number of Bloons in this emission

spacing System.Single

Space between each bloon in this emission

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

GameModelExt.CreateBloonGroup(this GameModel, string, float, float, int) Method

Creates a BloonGroup

public static BloonGroupModel CreateBloonGroup(this GameModel model, string bloonName, float startTime, float spacing, int count);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

bloonName System.String

startTime System.Single

spacing System.Single

count System.Int32

Returns

Il2CppAssets.Scripts.Models.Rounds.BloonGroupModel

GameModelExt.DoesBloonExist(this GameModel, string) Method

Returns whether or not a bloon exists with this name

public static bool DoesBloonExist(this GameModel gameModel, string bloonName);

Parameters

gameModel Il2CppAssets.Scripts.Models.GameModel

bloonName System.String

Returns

System.Boolean

GameModelExt.DoesTowerDetailsExist(this GameModel, string) Method

Returns whether or not any TowerDetailsModels in Il2CppAssets.Scripts.Models.GameModel.towerSet have towerId
in it's name

public static bool DoesTowerDetailsExist(this GameModel model, string towerId);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerId System.String

Returns

System.Boolean

GameModelExt.DoesTowerModelExist(this GameModel, string) Method

Returns whether or not any TowerModels in Il2CppAssets.Scripts.Models.GameModel.towers have towerId
in it's name

public static bool DoesTowerModelExist(this GameModel model, string towerId);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerId System.String

Returns

System.Boolean

GameModelExt.GetAllAbilityModels(this GameModel) Method

Return all AbilityModels from every TowerModel in the game

public static System.Collections.Generic.List<AbilityModel> GetAllAbilityModels(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.Behaviors.Abilities.AbilityModel>

GameModelExt.GetAllAttackModels(this GameModel) Method

Return all AttackModels from every TowerModel in the game

public static System.Collections.Generic.IEnumerable<AttackModel> GetAllAttackModels(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

System.Collections.Generic.IEnumerable<Il2CppAssets.Scripts.Models.Towers.Behaviors.Attack.AttackModel>

GameModelExt.GetAllProjectileModels(this GameModel) Method

Return all ProjectileModels from every TowerModel in the game

public static System.Collections.Generic.List<ProjectileModel> GetAllProjectileModels(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.Projectiles.ProjectileModel>

GameModelExt.GetAllShopTowerDetails(this GameModel) Method

Return all ShopTowerDetailModels

public static List<ShopTowerDetailsModel> GetAllShopTowerDetails(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

Il2CppSystem.Collections.Generic.List

GameModelExt.GetAllTowerDetails(this GameModel) Method

Return all TowerDetailModels

public static List<TowerDetailsModel> GetAllTowerDetails(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

Il2CppSystem.Collections.Generic.List

GameModelExt.GetAllWeaponModels(this GameModel) Method

Return all WeaponModels from every AttackModel in the game

public static System.Collections.Generic.List<WeaponModel> GetAllWeaponModels(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.Weapons.WeaponModel>

GameModelExt.GetTowerDetails(this GameModel, string) Method

Returns the first TowerDetailsModel in Il2CppAssets.Scripts.Models.GameModel.towerSet that has a towerId of
towerDetailsName

public static TowerDetailsModel GetTowerDetails(this GameModel model, string towerDetailsName);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerDetailsName System.String

The Il2CppAssets.Scripts.Models.TowerSets.TowerDetailsModel.towerId you are searching for

Returns

Il2CppAssets.Scripts.Models.TowerSets.TowerDetailsModel
The first TowerDetailsModel found, otherwise returns null

GameModelExt.GetTowerModel(this GameModel, string, int, int, int) Method

Get a TowerModel from model.towers.
NOTE: model.GetTower cannot get custom towers so use this method instead

public static TowerModel GetTowerModel(this GameModel model, string towerId, int path1=0, int path2=0, int path3=0);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

towerId System.String

path1 System.Int32

path2 System.Int32

path3 System.Int32

Returns

Il2CppAssets.Scripts.Models.Towers.TowerModel

GameModelExt.GetTowerModels(this GameModel, string) Method

Return all TowerModels with a specific base id

public static System.Collections.Generic.List<TowerModel> GetTowerModels(this GameModel model, string towerBaseId);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

the GameModel instance

towerBaseId System.String

The base id all towers should share. Example: "DartMonkey"

Returns

System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.TowerModel>

GameModelExt.GetTowerModelsWithAbilities(this GameModel) Method

Return all TowerModels that have at least one AbilityModel

public static System.Collections.Generic.List<TowerModel> GetTowerModelsWithAbilities(this GameModel model);

Parameters

model Il2CppAssets.Scripts.Models.GameModel

Returns

System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.TowerModel>

To learn how to download BTD Mod Helper and install mods, click here