Table of Contents
Extensions for Game
public static class GameExt
Inheritance System.Object GameExt
Add Monkey Money to player's total Monkey Money
public static void AddMonkeyMoney(this Game game, double amount);
game
Il2CppAssets.Scripts.Unity.Game
the Game instance
amount
System.Double
Amount to add
Checks if Player is in a game mode that would get them flagged if using mods
public static bool CanGetFlagged(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Returns a new SpriteReference that uses the given guid
public static SpriteReference CreateSpriteReference(this Game game, string guid);
game
Il2CppAssets.Scripts.Unity.Game
guid
System.String
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
Get the Btd6Player data for the player. Contains different info than PlayerProfile
public static Btd6Player GetBtd6Player(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.Player.Btd6Player
Get the instance of CommonBackgroundScreen
public static CommonBackgroundScreen GetCommonBackgroundScreen(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.UI_New.CommonBackgroundScreen
Get the instance of CommonForegroundScreen
public static CommonForegroundScreen GetCommonForegroundScreen(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.UI_New.CommonForegroundScreen
Returns the current lobby connection.
public static LobbyConnection GetCoopLobbyConnection(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppNinjaKiwi.LiNK.Lobbies.LobbyConnection
Returns the current lobby screen.
public static CoopLobbyScreen GetCoopLobbyScreen(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.UI_New.Coop.CoopLobbyScreen
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);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.Display.Factory
Get all HeroDetailModels
public static Il2CppReferenceArray<TowerDetailsModel> GetHeroDetailModels(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray
Get the instance of LocalizationManager
public static LocalizationManager GetLocalizationManager(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppNinjaKiwi.Common.LocalizationManager
Returns the instance of the Map Loader.
public static MapLoader GetMapLoader(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.Map.MapLoader
Get the instance of MenuManager
public static MenuManager GetMenuManager(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.Menu.MenuManager
Get GameModel. Same as using Game.instance.model
public static GameModel GetModel(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Models.GameModel
Get player's current Monkey Money amount
public static double GetMonkeyMoney(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Get nkGI for the current session. Will be null if not in multiplayer game or lobby
public static NKMultiGameInterface GetNkGI(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppNinjaKiwi.NKMulti.NKMultiGameInterface
Get the ProfileModel for the Player
public static ProfileModel GetPlayerProfile(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Models.Profile.ProfileModel
Get the PlayerService for the player
public static PlayerService GetPlayerService(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.Player.PlayerService
Get the instance of PopupScreen
public static PopupScreen GetPopupScreen(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.UI_New.Popups.PopupScreen
Get all PowerDetailModels
public static Il2CppReferenceArray<PowerDetailsModel> GetPowerDetailModels(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray
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);
game
Il2CppAssets.Scripts.Unity.Game
Get the instance of ShopMenu
public static ShopMenu GetShopMenu(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.UI_New.InGame.RightMenu.ShopMenu
Get all TowerDetailModels
public static Il2CppReferenceArray<TowerDetailsModel> GetTowerDetailModels(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppReferenceArray
Not tested
public static System.Collections.Generic.List<TowerModel> GetTowerListForTowerType(this Game game, TowerSet towerSet);
game
Il2CppAssets.Scripts.Unity.Game
towerSet
Il2CppAssets.Scripts.Models.TowerSets.TowerSet
System.Collections.Generic.List<Il2CppAssets.Scripts.Models.Towers.TowerModel>
Get the instance of UI
public static UI GetUI(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Il2CppAssets.Scripts.Unity.UI_New.UI
Returns whether or not the player's account is currently flagged/hackerpooled
public static bool IsAccountFlagged(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Returns if Player is in a Odyssey game
public static bool IsInOdyssey(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Returns if Player is in a public co-op match
public static bool IsInPublicCoop(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Returns if Player is in a race
public static bool IsInRace(this Game game);
game
Il2CppAssets.Scripts.Unity.Game
Makes a save of Player.Save at the specified path
public static void SavePlayerData(this Game game, string savePath);
game
Il2CppAssets.Scripts.Unity.Game
savePath
System.String
Path to save to
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);
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
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);
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
Schedule a task to execute right now as a Coroutine
public static void ScheduleTask(this Game game, System.Collections.IEnumerator iEnumerator);
game
Il2CppAssets.Scripts.Unity.Game
iEnumerator
System.Collections.IEnumerator
Set player's Monkey Money amount
public static void SetMonkeyMoney(this Game game, double amount);
game
Il2CppAssets.Scripts.Unity.Game
the Game instance
amount
System.Double
Value to set Monkey Money to
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);
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
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);
game
Il2CppAssets.Scripts.Unity.Game
the Game instance
message
System.String
Message body
title
System.String
Message title. Will be mod name by default