public unsafe static void Execute(ref T data, IntPtr animationStreamPtr, IntPtr methodIndex, ref JobRanges ranges, int jobIndex) { AnimationStream stream; UnsafeUtility.CopyPtrToStructure <AnimationStream>((void *)animationStreamPtr, out stream); JobMethodIndex jobMethodIndex = (JobMethodIndex)methodIndex.ToInt32(); JobMethodIndex jobMethodIndex2 = jobMethodIndex; JobMethodIndex jobMethodIndex3 = jobMethodIndex2; if (jobMethodIndex3 != JobMethodIndex.ProcessRootMotionMethodIndex) { if (jobMethodIndex3 != JobMethodIndex.ProcessAnimationMethodIndex) { throw new NotImplementedException("Invalid Animation jobs method index."); } data.ProcessAnimation(stream); } else { data.ProcessRootMotion(stream); } }
public static unsafe void Execute(ref T data, IntPtr animationStreamPtr, IntPtr methodIndex, ref JobRanges ranges, int jobIndex) { AnimationStream animationStream; UnsafeUtility.CopyPtrToStructure((void *)animationStreamPtr, out animationStream); JobMethodIndex jobMethodIndex = (JobMethodIndex)methodIndex.ToInt32(); switch (jobMethodIndex) { case JobMethodIndex.ProcessRootMotionMethodIndex: data.ProcessRootMotion(animationStream); break; case JobMethodIndex.ProcessAnimationMethodIndex: data.ProcessAnimation(animationStream); break; default: throw new NotImplementedException("Invalid Animation jobs method index."); } }