您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
19 行
518 B
19 行
518 B
using UnityEngine;
|
|
using Unity.Entities;
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
public class LocalPlayerAuthoring : MonoBehaviour, IConvertGameObjectToEntity, IPrefabAsset
|
|
{
|
|
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
|
|
{
|
|
var lp = LocalPlayer.Default();
|
|
var buf = dstManager.AddBuffer<UserCommand>(entity);
|
|
buf.ResizeUninitialized(PlayerModuleClient.commandClientBufferSize);
|
|
dstManager.AddComponentData(entity, lp);
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|
|
|