您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
27 行
927 B
27 行
927 B
#if UNITY_EDITOR
|
|
|
|
using Unity.Entities;
|
|
|
|
public class AnimSourceTwistAuthoring : AnimSourceAuthoring, IConvertGameObjectToEntity
|
|
{
|
|
public Unity.Animation.Hybrid.RigComponent RigReference;
|
|
public AnimSourceTwist.BoneReferences BoneReferences;
|
|
public AnimSourceTwist.Factors Factors;
|
|
public bool invertTwist;
|
|
|
|
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
|
|
{
|
|
dstManager.AddComponentData(entity, new AnimSource.Data());
|
|
|
|
var settings = new AnimSourceTwist.Settings();
|
|
settings.rigReference = RigDefinitionAsset.ConvertRig(RigReference);
|
|
settings.boneReferences = BoneReferences;
|
|
settings.factors = Factors;
|
|
settings.twistMult = invertTwist ? -1f : 1f;
|
|
|
|
dstManager.AddComponentData(entity, settings);
|
|
dstManager.AddComponentData(entity, AnimSource.AllowWrite.Default);
|
|
}
|
|
}
|
|
|
|
#endif
|