Skip to Main Content

BTD_Mod_Helper​.Api​.ModByteLoader


BloonsTD6 Mod Helper

BTD_Mod_Helper.Api

ModByteLoader Class

A class that can be generated by your mod in order to statically load a big complex Model object in your mod, like
Ninja Kiwi does with the whole GameModel

public abstract class ModByteLoader : BTD_Mod_Helper.Api.ModContent

Inheritance System.ObjectModContent  ModByteLoader

Derived
ModByteLoader<T>

Fields

ModByteLoader.m Field

The array of object that NinjaKiwi programmed the loader to utilize

protected object[] m;

Field Value

System.Object[]

Properties

ModByteLoader.Bytes Property

The bytes that will be loaded from

protected byte[] Bytes { get; set; }

Property Value

System.Byte[]

ModByteLoader.BytesFileName Property

The file name of the bytes file within your project.

Remember to add it as an embedded resource!

protected abstract string BytesFileName { get; }

Property Value

System.String

ModByteLoader.Loaded Property

Whether the Result has been Loaded yet

public bool Loaded { get; set; }

Property Value

System.Boolean

ModByteLoader.LoadTask Property

The Task responsible for loading the bytes in the background

protected Task LoadTask { get; set; }

Property Value

Il2CppSystem.Threading.Tasks.Task

Methods

ModByteLoader.ConvertLoader(string, string, string, string, string) Method

Converts a generated Loader using normal System data structures to one that uses IL2Cpp ones

private static void ConvertLoader<T>(string unconvertedLoader, string convertedLoader, string className, string bytesFileName, string nameSpace=null)
    where T : Object;

Type parameters

T

Parameters

unconvertedLoader System.String

convertedLoader System.String

className System.String

bytesFileName System.String

nameSpace System.String

ModByteLoader.Generate(T, string, string, string) Method

Generates a ModByteLoader class and corresponding .bytes file within the BloonsTD6 directory

public static void Generate<T>(T model, string loaderFilePath, string bytesFilePath, string nameSpace=null)
    where T : Object;

Type parameters

T

Parameters

model T

The model that you want to be able to be statically loaded from bytes

loaderFilePath System.String

The absolute file path on your system where the .cs Loader file should end up

bytesFilePath System.String

The absolute file path on your system where the bytes file should end up

nameSpace System.String

If included, namespace to add to the loader cs file

ModByteLoader.Load() Method

Set up the bytes when this is loaded

public sealed override System.Collections.Generic.IEnumerable<BTD_Mod_Helper.Api.ModContent> Load();

Returns

System.Collections.Generic.IEnumerable<ModContent>

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