I’m trying to create a moddable game, where mods provide new code (both managed and burst). Here’s the code in the mod
`[BurstCompile]
public class BurstTest : MonoBehaviour
{
public TMP_Text text;
private int counter = 0;
void Update()
{
counter++;
int result = GetTESTNum(counter);
text.text = "Result: " + result;
}
[BurstCompile]
private static int GetTESTNum(int input)
{
int result = input * 2;
result += 6;
result = result / 2;
return result; //whatever, I just want to PoC that it runs in burst
}
}`
This runs fine if I’m in the mod project, but if I’m in my main project, where I load this in via DLL, I get errors.
Exporting: Runs a build, generates a managed DLL for my mod’s script assembly, as well as a burst DLL
Importing:
AssemblyUtility.registerAssembly(managedDLLPath); BurstRuntime.LoadAdditionalLibrary(burstDLLPath);
Seems to work fine, at least, doesn’t throw any exceptions. However, I get a whole bunch of exceptions from my GetTESTNum method, below: