mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2024-11-10 06:35:18 +01:00
26 lines
791 B
C#
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} );
|
|||
|
}
|
|||
|
}
|
|||
|
}
|