1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- using UnityEngine.Animations;
- using Unity.Collections;
- namespace Animancer
- {
-
-
-
-
-
-
-
-
-
- public class AnimatedFloat : AnimatedProperty<AnimatedFloat.Job, float>
- {
-
-
-
-
-
- public AnimatedFloat(IAnimancerComponent animancer, int propertyCount,
- NativeArrayOptions options = NativeArrayOptions.ClearMemory)
- : base(animancer, propertyCount, options)
- { }
-
- public AnimatedFloat(IAnimancerComponent animancer, string propertyName)
- : base(animancer, propertyName)
- { }
-
- public AnimatedFloat(IAnimancerComponent animancer, params string[] propertyNames)
- : base(animancer, propertyNames)
- { }
-
- protected override void CreateJob()
- {
- _Job = new Job() { properties = _Properties, values = _Values };
- }
-
-
-
-
- public struct Job : IAnimationJob
- {
- public NativeArray<PropertyStreamHandle> properties;
- public NativeArray<float> values;
- public void ProcessRootMotion(AnimationStream stream) { }
- public void ProcessAnimation(AnimationStream stream)
- {
- for (int i = properties.Length - 1; i >= 0; i--)
- values[i] = properties[i].GetFloat(stream);
- }
- }
-
- }
- }
|