Skip to Main Content
Table of Contents

BTD_Mod_Helper​.Extensions​.GameExt


BloonsTD6 Mod Helper

BTD_Mod_Helper.Extensions

GameExt Class

Extensions for Game

public static class GameExt

Inheritance System.Object  GameExt

Methods

GameExt.AddMonkeyMoney(this Game, double) Method

Add Monkey Money to player's total Monkey Money

public static void AddMonkeyMoney(this Game game, double amount);

Parameters

game Il2CppAssets.Scripts.Unity.Game

the Game instance

amount System.Double

Amount to add

GameExt.CanGetFlagged(this Game) Method

Checks if Player is in a game mode that would get them flagged if using mods

public static bool CanGetFlagged(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.Boolean

GameExt.CreateSpriteReference(this Game, string) Method

Returns a new SpriteReference that uses the given guid

public static SpriteReference CreateSpriteReference(this Game game, string guid);

Parameters

game Il2CppAssets.Scripts.Unity.Game

guid System.String

Returns

Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference

GameExt.GetBtd6Player(this Game) Method

Get the Btd6Player data for the player. Contains different info than PlayerProfile

public static Btd6Player GetBtd6Player(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.Player.Btd6Player

GameExt.GetCommonBackgroundScreen(this Game) Method

Get the instance of CommonBackgroundScreen

public static CommonBackgroundScreen GetCommonBackgroundScreen(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.UI_New.CommonBackgroundScreen

GameExt.GetCommonForegroundScreen(this Game) Method

Get the instance of CommonForegroundScreen

public static CommonForegroundScreen GetCommonForegroundScreen(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.UI_New.CommonForegroundScreen

GameExt.GetCoopLobbyConnection(this Game) Method

Returns the current lobby connection.

public static LobbyConnection GetCoopLobbyConnection(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppNinjaKiwi.LiNK.Lobbies.LobbyConnection

GameExt.GetCoopLobbyScreen(this Game) Method

Returns the current lobby screen.

public static CoopLobbyScreen GetCoopLobbyScreen(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.UI_New.Coop.CoopLobbyScreen

GameExt.GetDisplayFactory(this Game) Method

Get the Unity Display Factory that manages on screen sprites. This Factory is different from other Factories in the
game

public static Factory GetDisplayFactory(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.Display.Factory

GameExt.GetHeroDetailModels(this Game) Method

Get all HeroDetailModels

public static Il2CppReferenceArray<TowerDetailsModel> GetHeroDetailModels(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

GameExt.GetLocalizationManager(this Game) Method

Get the instance of LocalizationManager

public static LocalizationManager GetLocalizationManager(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppNinjaKiwi.Common.LocalizationManager

GameExt.GetMapLoader(this Game) Method

Returns the instance of the Map Loader.

public static MapLoader GetMapLoader(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.Map.MapLoader

GameExt.GetMenuManager(this Game) Method

Get the instance of MenuManager

public static MenuManager GetMenuManager(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.Menu.MenuManager

GameExt.GetModel(this Game) Method

Get GameModel. Same as using Game.instance.model

public static GameModel GetModel(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Models.GameModel

GameExt.GetMonkeyMoney(this Game) Method

Get player's current Monkey Money amount

public static double GetMonkeyMoney(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.Double

GameExt.GetNkGI(this Game) Method

Get nkGI for the current session. Will be null if not in multiplayer game or lobby

public static NKMultiGameInterface GetNkGI(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppNinjaKiwi.NKMulti.NKMultiGameInterface

GameExt.GetPlayerProfile(this Game) Method

Get the ProfileModel for the Player

public static ProfileModel GetPlayerProfile(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Models.Profile.ProfileModel

GameExt.GetPlayerService(this Game) Method

Get the PlayerService for the player

public static PlayerService GetPlayerService(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.Player.PlayerService

GameExt.GetPopupScreen(this Game) Method

Get the instance of PopupScreen

public static PopupScreen GetPopupScreen(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.UI_New.Popups.PopupScreen

GameExt.GetPowerDetailModels(this Game) Method

Get all PowerDetailModels

public static Il2CppReferenceArray<PowerDetailsModel> GetPowerDetailModels(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

GameExt.GetSaveDirectory(this Game) Method

Returns the directory where the Player's Profile.save file is located.
Not set until after reaching the Main Menu for the first time

public static string GetSaveDirectory(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.String

GameExt.GetShopMenu(this Game) Method

Get the instance of ShopMenu

public static ShopMenu GetShopMenu(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.UI_New.InGame.RightMenu.ShopMenu

GameExt.GetTowerDetailModels(this Game) Method

Get all TowerDetailModels

public static Il2CppReferenceArray<TowerDetailsModel> GetTowerDetailModels(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray

GameExt.GetTowerListForTowerType(this Game, TowerSet) Method

Not tested

public static System.Collections.Generic.List<TowerModel> GetTowerListForTowerType(this Game game, TowerSet towerSet);

Parameters

game Il2CppAssets.Scripts.Unity.Game

towerSet Il2CppAssets.Scripts.Models.TowerSets.TowerSet

Returns

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

GameExt.GetUI(this Game) Method

Get the instance of UI

public static UI GetUI(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

Il2CppAssets.Scripts.Unity.UI_New.UI

GameExt.IsAccountFlagged(this Game) Method

Returns whether or not the player's account is currently flagged/hackerpooled

public static bool IsAccountFlagged(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.Boolean

GameExt.IsInOdyssey(this Game) Method

Returns if Player is in a Odyssey game

public static bool IsInOdyssey(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.Boolean

GameExt.IsInPublicCoop(this Game) Method

Returns if Player is in a public co-op match

public static bool IsInPublicCoop(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.Boolean

GameExt.IsInRace(this Game) Method

Returns if Player is in a race

public static bool IsInRace(this Game game);

Parameters

game Il2CppAssets.Scripts.Unity.Game

Returns

System.Boolean

GameExt.SavePlayerData(this Game, string) Method

Makes a save of Player.Save at the specified path

public static void SavePlayerData(this Game game, string savePath);

Parameters

game Il2CppAssets.Scripts.Unity.Game

savePath System.String

Path to save to

GameExt.ScheduleTask(this Game, Action, ScheduleType, int, Func) Method

Schedule a task to execute later on as a Coroutine

public static void ScheduleTask(this Game game, System.Action action, BTD_Mod_Helper.Api.Enums.ScheduleType scheduleType, int amountToWait, System.Func<bool> waitCondition=null);

Parameters

game Il2CppAssets.Scripts.Unity.Game

action System.Action

The action you want to execute once it's time to run your task

scheduleType ScheduleType

How you want to wait for your task

amountToWait System.Int32

The amount you want to wait

waitCondition System.Func<System.Boolean>

Wait for this to be true before executing task

GameExt.ScheduleTask(this Game, Action, Func) Method

Schedule a task to execute later on as a Coroutine. By default will wait until the end of this current frame

public static void ScheduleTask(this Game game, System.Action action, System.Func<bool> waitCondition=null);

Parameters

game Il2CppAssets.Scripts.Unity.Game

action System.Action

The action you want to execute once it's time to run your task

waitCondition System.Func<System.Boolean>

Wait for this to be true before executing task

GameExt.ScheduleTask(this Game, IEnumerator) Method

Schedule a task to execute right now as a Coroutine

public static void ScheduleTask(this Game game, System.Collections.IEnumerator iEnumerator);

Parameters

game Il2CppAssets.Scripts.Unity.Game

iEnumerator System.Collections.IEnumerator

GameExt.SetMonkeyMoney(this Game, double) Method

Set player's Monkey Money amount

public static void SetMonkeyMoney(this Game game, double amount);

Parameters

game Il2CppAssets.Scripts.Unity.Game

the Game instance

amount System.Double

Value to set Monkey Money to

GameExt.ShowMessage(this Game, string, float, string) Method

Uses custom message popup to show a message in game. Currently only works in active game sessions and not on Main Menu

public static void ShowMessage(this Game game, string message, float displayTime, string title);

Parameters

game Il2CppAssets.Scripts.Unity.Game

the Game instance

message System.String

Message body

displayTime System.Single

Time to show message on screen

title System.String

Message title. Will be mod name by default

GameExt.ShowMessage(this Game, string, string) Method

Uses custom message popup to show a message in game. Currently only works in active game sessions and not on Main Menu

public static void ShowMessage(this Game game, string message, string title);

Parameters

game Il2CppAssets.Scripts.Unity.Game

the Game instance

message System.String

Message body

title System.String

Message title. Will be mod name by default

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