Hi, i tried to burst the instantation of gameObjects from a pool, like this:
[BurstCompile]
struct SpawnEnemyJob : IJob {
public Vector3[] enemySpawnPos;
public int spawnQueue;
public IPool pool;
public int i;
public void Execute() {
var enemy = pool.Get();
enemy.transform.position = enemySpawnPos[spawnQueue-i];
}
}
But i get the error that IPool is a managed type and not supported by bursty. According to docs, only native types (like int, bool, float, etc) are allowed (which makes sense as thats closer to machine assembly): https://docs.unity3d.com/Packages/com.unity.burst@1.0/manual/index.html
The only exception here are entities, right? These (along native types) can be used for bursting. But i am not sure if my understanding is correct.
But thank you for the infos, i think now i know where i can use bursty in my code (only few places, but i try to apply it where i can to get warm with burst, as i just started looking into this recently)