#classes in job struct

1 messages · Page 1 of 1 (latest)

meager carbon
#

hi, i know you cant use reference types in a job struct.. but is there an 'easy' way to work around that?
InvalidOperationException: GetEnemyActionJob.action is not a value type. Job structs may not contain any reference types.

public struct GetEnemyActionJob: IJob
{
    public GridPosition gridPosition;
    public BaseAction action;
    
    public void Execute()
    {
        action.GetEnemyAIAction(gridPosition);
    }
}```
torn phoenix
meager carbon
#

hmm what's that sorry

#

@torn phoenix im not using burst atm just the job system

torn phoenix
#

without burst you can access any managed logic through static references

#

but no managed fields on job struct itself