Table of Contents
ModContent serves two major purposes:
public abstract class ModContent :
BTD_Mod_Helper.Api.IModContent,
System.IComparable<BTD_Mod_Helper.Api.ModContent>
Inheritance System.Object ModContent
Derived
↳ ModCommand
↳ ModSettings
↳ ModTextOverride
↳ ModDisplay
↳ ModByteLoader
↳ ModGameMenu
↳ NamedModContent
↳ ModVanillaContent
Implements IModContent, System.IComparable<ModContent>
The BloonsTD6Mod that this content was added by
public BloonsMod mod;
The id that this ModContent will be given; a combination of the Mod's prefix and the name
public string Id { get; }
The name that will be at the end of the ID for this ModContent, by default the class name
public virtual string Name { get; }
The order that this ModContent will be loaded/registered in by Mod Helper.
Useful for changing the ordering that it will appear in in-game relative to other content of this type in your mod,
or for making certain content load before others like may be necessary for sub-towers.
Default/0 will use arbitrary ordering.
protected virtual int Order { get; }
Gets the ID for the given ModBloon
public static string BloonID<T>()
where T : BTD_Mod_Helper.Api.Bloons.ModBloon;
T
Returns a new AudioClipReference that uses the given guid
public static AudioClipReference CreateAudioClipReference(string guid);
guid
System.String
The guid that you'd like to assign to the AudioClipReference
Il2CppNinjaKiwi.Common.ResourceUtils.AudioClipReference
Returns a new AudioSourceReference that uses the given guid
public static AudioSourceReference CreateAudioSourceReference(string guid);
guid
System.String
The guid that you'd like to assign to the AudioSourceReference
Il2CppNinjaKiwi.Common.ResourceUtils.AudioSourceReference
Gets an AudioSource reference for a given sound within a mod
public static AudioSourceReference CreateAudioSourceReference<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
The mod
name
System.String
Sound name (no .wav)
Il2CppNinjaKiwi.Common.ResourceUtils.AudioSourceReference
An AudioSoundReference
Returns a new PrefabReference that uses the given guid
public static PrefabReference CreatePrefabReference(string guid);
guid
System.String
The guid that you'd like to assign to the PrefabReference
Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference
Creates a Prefab Reference for a ModDisplay
public static PrefabReference CreatePrefabReference<T>()
where T : BTD_Mod_Helper.Api.Display.ModDisplay;
T
Il2CppNinjaKiwi.Common.ResourceUtils.PrefabReference
Returns a new SpriteReference that uses the given guid
public static SpriteReference CreateSpriteReference(string guid);
guid
System.String
The guid that you'd like to assign to the SpriteReference
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
Finds the loaded ModContent with the given Id and type T
public static T Find<T>(string id)
where T : BTD_Mod_Helper.Api.ModContent;
T
Gets the ID for the given ModGameMode
public static string GameModeId<T>()
where T : BTD_Mod_Helper.Api.Scenarios.ModGameMode;
T
Gets an AudioClip from a mod by its name (no file extension included)
public static AudioClip GetAudioClip(BTD_Mod_Helper.BloonsMod mod, string name);
mod
BloonsMod
The mod
name
System.String
Sound name (no .wav)
UnityEngine.AudioClip
a playable AudioClip
Gets an AudioClip from this mod by its name (no file extension included)
public AudioClip GetAudioClip(string name);
name
System.String
Sound name (no .wav)
UnityEngine.AudioClip
a playable AudioClip
Gets an AudioClip from a mod by its name (no file extension included)
public static AudioClip GetAudioClip<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
The mod
name
System.String
Sound name (no .wav)
UnityEngine.AudioClip
a playable AudioClip
Gets an AudioSource reference for a given sound within a mod
public static AudioSourceReference GetAudioSourceReference(BTD_Mod_Helper.BloonsMod mod, string name);
mod
BloonsMod
name
System.String
Sound name (no .wav)
Il2CppNinjaKiwi.Common.ResourceUtils.AudioSourceReference
An AudioSoundReference
Gets an AudioSource reference for a given sound within this mod
public AudioSourceReference GetAudioSourceReference(string name);
name
System.String
Sound name (no .wav)
Il2CppNinjaKiwi.Common.ResourceUtils.AudioSourceReference
An AudioSoundReference
Gets an AudioSource reference for a given sound within a mod
public static AudioSourceReference GetAudioSourceReference<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
The mod
name
System.String
Sound name (no .wav)
Il2CppNinjaKiwi.Common.ResourceUtils.AudioSourceReference
An AudioSoundReference
Gets a bundle from a mod with the specified name (no file extension)
public static AssetBundle GetBundle(BTD_Mod_Helper.BloonsMod mod, string name);
mod
BloonsMod
name
System.String
Gets a bundle from your mod with the specified name (no file extension)
protected AssetBundle GetBundle(string name);
name
System.String
Gets a bundle from the mod T with the specified name (no file extension)
public static AssetBundle GetBundle<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
name
System.String
Gets all loaded ModContent objects that are T or a subclass of T
public static System.Collections.Generic.List<T> GetContent<T>()
where T : BTD_Mod_Helper.Api.ModContent;
T
System.Collections.Generic.List<T>
Gets the GUID (thing that should be used in the display field for things) for a specific ModDisplay
public static string GetDisplayGUID<T>()
where T : BTD_Mod_Helper.Api.Display.ModDisplay;
T
Gets the id of a resource by appending the mod's ID prefix to its name
public static string GetId(BTD_Mod_Helper.BloonsMod bloonsMod, string name);
bloonsMod
BloonsMod
name
System.String
Gets the id of a resource by appending the mod's ID prefix to its name
public string GetId(string name);
name
System.String
Gets the id of a resource by appending the mod's ID prefix to its name
public static string GetId<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
name
System.String
Gets the official instance of a particular ModContent or BloonsTD6Mod based on its type
public static BTD_Mod_Helper.Api.IModContent GetInstance(System.Type type);
type
System.Type
The type to get the instance of
IModContent
The official instance of it
Gets the singleton instance of a particular ModContent or BloonsTD6Mod based on its type
public static T GetInstance<T>()
where T : BTD_Mod_Helper.Api.IModContent;
T
The type to get the instance of
T
The singleton instance of it
Gets all loaded ModContent objects that are exactly of type T
public static System.Collections.Generic.List<T> GetInstances<T>()
where T : BTD_Mod_Helper.Api.ModContent;
T
System.Collections.Generic.List<T>
Gets a BloonsTD6Mod by its name, or returns null if none are loaded with that name
public static BTD_Mod_Helper.BloonsMod GetMod(string name);
name
System.String
Constructs a Sprite for a given texture name within a given mod
public static Sprite GetSprite(BTD_Mod_Helper.BloonsMod mod, string name, float pixelsPerUnit=10f);
mod
BloonsMod
name
System.String
The file name of your texture, without the extension
pixelsPerUnit
System.Single
The pixels per unit for the Sprite to have
UnityEngine.Sprite
A Sprite
Constructs a Sprite for a given texture name within this mod
protected Sprite GetSprite(string name, float pixelsPerUnit=10f);
name
System.String
The file name of your texture, without the extension
pixelsPerUnit
System.Single
The pixels per unit for the Sprite to have
UnityEngine.Sprite
A Sprite
Constructs a Sprite for a given texture name within a given mod
public static Sprite GetSprite<T>(string name, float pixelsPerUnit=10f)
where T : BTD_Mod_Helper.BloonsMod;
T
name
System.String
The file name of your texture, without the extension
pixelsPerUnit
System.Single
The pixels per unit for the Sprite to have
UnityEngine.Sprite
A Sprite
Gets a sprite reference by name for a specific mod
public static SpriteReference GetSpriteReference(BTD_Mod_Helper.BloonsMod mod, string name);
mod
BloonsMod
The BloonsTD6Mod that the texture is from
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for this mod
protected SpriteReference GetSpriteReference(string name);
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for a specific mod
public static SpriteReference GetSpriteReference<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
Your mod's main BloonsTD6Mod extending class
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for a specific mod, or if the mod does not include a texture with that name,
treats it as a vanilla sprite reference
public static SpriteReference GetSpriteReferenceOrDefault(BTD_Mod_Helper.BloonsMod mod, string name);
mod
BloonsMod
The BloonsTD6Mod that the texture is from
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for a specific mod, or if the mod does not include a texture with that name,
treats it as a vanilla sprite reference
protected SpriteReference GetSpriteReferenceOrDefault(string name);
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for a specific mod, or if the mod does not include a texture with that name,
treats it as a vanilla sprite reference
public static SpriteReference GetSpriteReferenceOrDefault<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
Your mod's main BloonsTD6Mod extending class
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for a specific mod, returning null if the texture hasn't currently been
loaded instead of an invalid SpriteReference
public static SpriteReference GetSpriteReferenceOrNull(BTD_Mod_Helper.BloonsMod mod, string name);
mod
BloonsMod
The BloonsTD6Mod that the texture is from
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for this mod, returning null if the texture hasn't currently been
loaded instead of an invalid SpriteReference
protected SpriteReference GetSpriteReferenceOrNull(string name);
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Gets a sprite reference by name for a specific mod, returning null if the texture hasn't currently been
loaded instead of an invalid SpriteReference
public static SpriteReference GetSpriteReferenceOrNull<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
Your mod's main BloonsTD6Mod extending class
name
System.String
The file name of your texture, without the extension
Il2CppNinjaKiwi.Common.ResourceUtils.SpriteReference
A new SpriteReference
Constructs a Texture2D for a given texture name within a mod
public static Texture2D GetTexture(BTD_Mod_Helper.BloonsMod bloonsMod, string fileName);
bloonsMod
BloonsMod
The mod that adds this texture
fileName
System.String
The file name of your texture, without the extension
UnityEngine.Texture2D
A Texture2D
Constructs a Texture2D for a given texture name within this mod
protected Texture2D GetTexture(string fileName);
fileName
System.String
The file name of your texture, without the extension
UnityEngine.Texture2D
A Texture2D
Constructs a Texture2D for a given texture name within a mod
public static Texture2D GetTexture<T>(string fileName)
where T : BTD_Mod_Helper.BloonsMod;
T
fileName
System.String
The file name of your texture, without the extension
UnityEngine.Texture2D
A Texture2D
Returns the Bytes associated with a texture.
public static byte[] GetTextureBytes(BTD_Mod_Helper.BloonsMod bloonsMod, string fileName);
bloonsMod
BloonsMod
The mod that adds this texture.
fileName
System.String
The file name of your texture, without the extension.
System.Byte[]
The bytes associated with the texture.
Returns the Bytes associated with a texture.
protected byte[] GetTextureBytes(string fileName);
fileName
System.String
The file name of your texture, without the extension.
System.Byte[]
The bytes associated with the texture.
Returns the Bytes associated with a texture.
public static byte[] GetTextureBytes<T>(string fileName)
where T : BTD_Mod_Helper.BloonsMod;
T
fileName
System.String
The file name of your texture, without the extension.
System.Byte[]
The bytes associated with the texture.
Gets a texture's GUID by name for a specific mod
public static string GetTextureGUID(BTD_Mod_Helper.BloonsMod mod, string fileName);
mod
BloonsMod
The BloonsTD6Mod that the texture is from
fileName
System.String
The file name of your texture, without the extension
System.String
The texture's GUID
Gets a texture's GUID by name for this mod
Returns null if a Texture hasn't been loaded with that name
public string GetTextureGUID(string name);
name
System.String
The file name of your texture, without the extension
System.String
The texture's GUID
Gets a texture's GUID by name for a specific mod, to be used in SpriteReferences
Returns null if a Texture hasn't been loaded with that name
public static string GetTextureGUID<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
Your mod's main BloonsTD6Mod extending class
name
System.String
The file name of your texture, without the extension
System.String
The texture's GUID
Gets the TowerModel for a ModTower at a specific tier level
public static TowerModel GetTowerModel<T>(int top=0, int mid=0, int bot=0)
where T : BTD_Mod_Helper.Api.Towers.ModTower;
T
The ModTower type
top
System.Int32
The top path tier
mid
System.Int32
The middle path tier
bot
System.Int32
The bottom path tier
Il2CppAssets.Scripts.Models.Towers.TowerModel
The tower name/id
Gets the fabricated TowerSet enum value for a ModTowerSet
public static TowerSet GetTowerSet<T>()
where T : BTD_Mod_Helper.Api.Towers.ModTowerSet;
T
Il2CppAssets.Scripts.Models.TowerSets.TowerSet
Returns whether a mod with the given name is installed, and pass it to the out param if it is
public static bool HasMod(string name, out BTD_Mod_Helper.BloonsMod bloonsMod);
name
System.String
bloonsMod
BloonsMod
Returns whether a mod with the given name is installed
public static bool HasMod(string name);
name
System.String
Creates the Instances of a ModContent type within a Mod and adds them to ModContentInstances
private static System.Collections.Generic.IEnumerable<BTD_Mod_Helper.Api.ModContent> Load(BTD_Mod_Helper.Api.ModContent instance);
instance
ModContent
System.Collections.Generic.IEnumerable<ModContent>
Registers some text to the LocalizationManager using the given key (combined with your mod id) for use with
the built in language system. NK texts components will Il2Cpp.NK_TextMeshProUGUI.AutoLocalize your keys.
public static string Localize(BTD_Mod_Helper.BloonsMod mod, string key, string text);
mod
BloonsMod
The mod
key
System.String
The localization key
text
System.String
The default English text
System.String
The Localization key
Registers some text to the LocalizationManager using the given key (combined with your mod id) for use with
the built in language system. NK texts components will Il2Cpp.NK_TextMeshProUGUI.AutoLocalize your keys.
public static string Localize(BTD_Mod_Helper.BloonsMod mod, string keyAndText);
mod
BloonsMod
The mod
keyAndText
System.String
System.String
The Localization key
Registers some text to the LocalizationManager using the given key (combined with your mod id) for use with
the built in language system. NK texts components will Il2Cpp.NK_TextMeshProUGUI.AutoLocalize your keys.
public string Localize(string key, string text);
key
System.String
The localization key
text
System.String
The default English text
System.String
The Localization key
Registers some text to the LocalizationManager using the given key (combined with your mod id) for use with
the built in language system. NK texts components will Il2Cpp.NK_TextMeshProUGUI.AutoLocalize your keys.
public string Localize(string keyAndText);
keyAndText
System.String
System.String
The Localization key
Registers some text to the LocalizationManager using the given key (combined with your mod id) for use with
the built in language system. NK texts components will Il2Cpp.NK_TextMeshProUGUI.AutoLocalize your keys.
public static string Localize<T>(string key, string text)
where T : BTD_Mod_Helper.BloonsMod;
T
key
System.String
The localization key
text
System.String
The default English text
System.String
The Localization key
Registers some text to the LocalizationManager using the given key (combined with your mod id) for use with
the built in language system. NK texts components will Il2Cpp.NK_TextMeshProUGUI.AutoLocalize your keys.
public static string Localize<T>(string keyAndText)
where T : BTD_Mod_Helper.BloonsMod;
T
keyAndText
System.String
System.String
The Localization key
Gets the ID for the given ModRoundSet
public static string RoundSetId<T>()
where T : BTD_Mod_Helper.Api.Bloons.ModRoundSet;
T
Gets whether a texture with a given name has been loaded by the Mod Helper for a mod
public static bool TextureExists(BTD_Mod_Helper.BloonsMod bloonsMod, string name);
bloonsMod
BloonsMod
The mod to look in
name
System.String
The file name of your texture, without the extension
Gets whether a texture with a given name has been loaded by the Mod Helper for this mod
protected bool TextureExists(string name);
name
System.String
The file name of your texture, without the extension
Gets whether a texture with a given name has been loaded by the Mod Helper for a mod
public static bool TextureExists<T>(string name)
where T : BTD_Mod_Helper.BloonsMod;
T
The mod to look in
name
System.String
The file name of your texture, without the extension
Gets the internal tower name/id for a ModTower
public static string TowerID<T>(int top=0, int mid=0, int bot=0)
where T : BTD_Mod_Helper.Api.Towers.ModTower;
T
The ModTower type
top
System.Int32
The top path tier
mid
System.Int32
The middle path tier
bot
System.Int32
The bottom path tier
System.String
The tower name/id
Finds the loaded ModContent with the given Id and type T
public static bool TryFind<T>(string id, out T result)
where T : BTD_Mod_Helper.Api.ModContent;
T
result
T
Gets the internal upgrade name/id for a ModUpgrade
public static string UpgradeID<T>()
where T : BTD_Mod_Helper.Api.Towers.ModUpgrade;
T
The ModUpgrade type
System.String
The upgrade name/id