IJobEntity struct layout

Hi!
Scripting on UnityECS, I’ve got a Job struct which rotates player’s head around Y axis with a simple code:

[BurstCompile]
public partial struct PlayerHeadYRotateJob : IJobEntity
{
    public float sensetivity;
    public float yValue;
    
    private void Execute(ref LocalTransform localTransform, ref ModelData model)
    {
        localTransform.Rotation.value = model.BeginRotation.SemiQuaternionAngleAxis(
                yValue * sensetivity, new float3(1, 0, 0));
    }
}

But there I have a warning:

There is no defined ordering between fields in multiple declarations of partial struct ‘PlayerHeadYRotateJob’. To specify an ordering, all instance fields must be in the same declaration.

My IDE advise me to add [StructLayout(LayoutKind.Auto)] before this Job, but I’ve found informations telling that’s not a best option (“The BurstCompiler doesn’t work correctly with this automatics”). I already know that’s because of fields that I’ve used in Job, but there’s no information what to do with it.

How can I get rid of this warning (and does it even worth it)?

1 Answer

1

Is this an Editor warning? If not then ignore it. IDE can become confused by code generation happening here (partial keyword is for codegen here).