mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2024-11-14 00:05:35 +01:00
31 lines
725 B
C#
31 lines
725 B
C#
using Unity.Entities;
|
|
using Unity.Collections;
|
|
|
|
namespace TAO.VertexAnimation.Example4
|
|
{
|
|
public class AntAnimationComponentAuthoring : UnityEngine.MonoBehaviour, IConvertGameObjectToEntity
|
|
{
|
|
[UnityEngine.SerializeField]
|
|
private VA_Animation idle;
|
|
|
|
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
|
|
{
|
|
AntAnimationComponent sampleAnimationComponent = new AntAnimationComponent
|
|
{
|
|
curAnimation = idle.GetName(),
|
|
idle = idle.GetName(),
|
|
|
|
|
|
|
|
|
|
};
|
|
dstManager.AddComponentData(entity, sampleAnimationComponent);
|
|
}
|
|
}
|
|
|
|
public struct AntAnimationComponent : IComponentData
|
|
{
|
|
public FixedString64 curAnimation;
|
|
public FixedString64 idle;
|
|
}
|
|
} |