您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
40 行
878 B
40 行
878 B
using Unity.Entities;
|
|
using UnityEngine;
|
|
|
|
[ServerOnlyComponent]
|
|
public partial class SpawnPoint : MonoBehaviour, IConvertGameObjectToEntity
|
|
{
|
|
public int teamIndex;
|
|
|
|
public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
|
|
{
|
|
dstManager.AddComponentData(entity,new State
|
|
{
|
|
teamIndex = teamIndex,
|
|
});
|
|
|
|
#if UNITY_EDITOR
|
|
dstManager.SetName(entity, "Entity " + entity.Index + " GameObject:" + name);
|
|
#endif
|
|
|
|
}
|
|
|
|
#if UNITY_EDITOR
|
|
void OnDrawGizmos()
|
|
{
|
|
Gizmos.DrawCube(transform.position + transform.up, new Vector3(0.5f, 2.0f, 0.5f));
|
|
Gizmos.DrawRay(transform.position + transform.up * 1.5f, transform.forward);
|
|
}
|
|
|
|
#endif
|
|
}
|
|
|
|
|
|
|
|
public partial class SpawnPoint
|
|
{
|
|
public struct State : IComponentData
|
|
{
|
|
public int teamIndex;
|
|
}
|
|
}
|