VertexAnimation/Runtime/Scripts/AnimationDataComponentAuthoring.cs
2022-12-10 15:02:53 +01:00

26 lines
791 B
C#

using Unity.Entities;
using Unity.Mathematics;
using UnityEngine;
namespace TAO.VertexAnimation
{
public class AnimationDataComponentAuthoring : MonoBehaviour
{
public float4 AnimationDataOne;
public float4 AnimationDataTwo;
public float BlendFactor;
}
public class AnimationDataComponentBaker : Baker < AnimationDataComponentAuthoring >
{
public override void Bake( AnimationDataComponentAuthoring authoring )
{
//Entity parent = GetEntity( authoring.RootParent );
AddComponent( new FirstAnimationDataComponent{ Value = authoring.AnimationDataOne} );
AddComponent( new SecondAnimationDataComponent{ Value = authoring.AnimationDataTwo} );
AddComponent( new BlendingAnimationDataComponent{ Value = authoring.BlendFactor} );
}
}
}