您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
24 行
608 B
24 行
608 B
#if UNITY_EDITOR
|
|
|
|
using Unity.Animation;
|
|
using Unity.Entities;
|
|
using UnityEngine;
|
|
|
|
public class AnimSourceSingleClipAuthoring : AnimSourceAuthoring, IConvertGameObjectToEntity
|
|
{
|
|
public AnimationClip Clip;
|
|
|
|
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
|
|
{
|
|
dstManager.AddComponentData(entity, new AnimSource.Data());
|
|
|
|
var settings = new AnimSourceSingleClip.Settings
|
|
{
|
|
Clip = ClipBuilder.AnimationClipToDenseClip(Clip),
|
|
};
|
|
|
|
dstManager.AddComponentData(entity, settings);
|
|
}
|
|
}
|
|
|
|
#endif
|