该项目的目的是同时测试和演示来自 Unity DOTS 技术堆栈的多个新包。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

22 行
885 B

using Unity.Entities;
using UnityEngine;
public class AbilityMeleeAuthoring : MonoBehaviour, IConvertGameObjectToEntity
{
public AbilityMelee.Settings settings;
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
{
// Ability components
dstManager.AddComponentData(entity, new Ability.AbilityTag { Value = Ability.AbilityTagValue.Melee });
dstManager.AddComponentData(entity, settings);
var localState = new AbilityMelee.State
{
rayQueryId = -1,
};
dstManager.AddComponentData(entity, localState);
dstManager.AddComponentData(entity, new AbilityMelee.PredictedState());
dstManager.AddComponentData(entity, new AbilityMelee.InterpolatedState());
dstManager.AddComponentData(entity, Ability.AbilityAction.Default );
}
}