using Unity.Collections; using Unity.Jobs; using LitMotion; using LitMotion.Adapters; [assembly: RegisterGenericJobType(typeof(MotionUpdateJob))] [assembly: RegisterGenericJobType(typeof(MotionUpdateJob))] [assembly: RegisterGenericJobType(typeof(MotionUpdateJob))] [assembly: RegisterGenericJobType(typeof(MotionUpdateJob))] [assembly: RegisterGenericJobType(typeof(MotionUpdateJob))] namespace LitMotion.Adapters { public readonly struct FixedString32BytesMotionAdapter : IMotionAdapter { public FixedString32Bytes Evaluate(ref FixedString32Bytes startValue, ref FixedString32Bytes endValue, ref StringOptions options, in MotionEvaluationContext context) { var start = startValue; var end = endValue; var customScrambleChars = options.CustomScrambleChars; ref var randomState = ref options.RandomState; if (randomState.state == 0) randomState = ref SharedRandom.Random; FixedStringHelper.Interpolate(ref start, ref end, context.Progress, options.ScrambleMode, options.RichTextEnabled, ref randomState, ref customScrambleChars, out var result); return result; } } public readonly struct FixedString64BytesMotionAdapter : IMotionAdapter { public FixedString64Bytes Evaluate(ref FixedString64Bytes startValue, ref FixedString64Bytes endValue, ref StringOptions options, in MotionEvaluationContext context) { var start = startValue; var end = endValue; var customScrambleChars = options.CustomScrambleChars; ref var randomState = ref options.RandomState; if (randomState.state == 0) randomState = ref SharedRandom.Random; FixedStringHelper.Interpolate(ref start, ref end, context.Progress, options.ScrambleMode, options.RichTextEnabled, ref randomState, ref customScrambleChars, out var result); return result; } } public readonly struct FixedString128BytesMotionAdapter : IMotionAdapter { public FixedString128Bytes Evaluate(ref FixedString128Bytes startValue, ref FixedString128Bytes endValue, ref StringOptions options, in MotionEvaluationContext context) { var start = startValue; var end = endValue; var customScrambleChars = options.CustomScrambleChars; ref var randomState = ref options.RandomState; if (randomState.state == 0) randomState = ref SharedRandom.Random; FixedStringHelper.Interpolate(ref start, ref end, context.Progress, options.ScrambleMode, options.RichTextEnabled, ref randomState, ref customScrambleChars, out var result); return result; } } public readonly struct FixedString512BytesMotionAdapter : IMotionAdapter { public FixedString512Bytes Evaluate(ref FixedString512Bytes startValue, ref FixedString512Bytes endValue, ref StringOptions options, in MotionEvaluationContext context) { var start = startValue; var end = endValue; var customScrambleChars = options.CustomScrambleChars; ref var randomState = ref options.RandomState; if (randomState.state == 0) randomState = ref SharedRandom.Random; FixedStringHelper.Interpolate(ref start, ref end, context.Progress, options.ScrambleMode, options.RichTextEnabled, ref randomState, ref customScrambleChars, out var result); return result; } } public readonly struct FixedString4096BytesMotionAdapter : IMotionAdapter { public FixedString4096Bytes Evaluate(ref FixedString4096Bytes startValue, ref FixedString4096Bytes endValue, ref StringOptions options, in MotionEvaluationContext context) { var start = startValue; var end = endValue; var customScrambleChars = options.CustomScrambleChars; ref var randomState = ref options.RandomState; if (randomState.state == 0) randomState = ref SharedRandom.Random; FixedStringHelper.Interpolate(ref start, ref end, context.Progress, options.ScrambleMode, options.RichTextEnabled, ref randomState, ref customScrambleChars, out var result); return result; } } }