mirror of
https://github.com/DCFApixels/DragonECS-Unity.git
synced 2025-09-18 18:14:35 +08:00
26 lines
586 B
C#
26 lines
586 B
C#
using UnityEngine;
|
|
|
|
namespace DCFApixels.DragonECS
|
|
{
|
|
public interface ITemplate
|
|
{
|
|
public void Apply(EcsWorld world, int entityID);
|
|
}
|
|
|
|
public interface ITemplateInternal : ITemplate
|
|
{
|
|
// internal ITemplateBrowsable[] Components { get; set; }
|
|
internal string ComponentsPropertyName { get; }
|
|
}
|
|
|
|
public static class ITemplateExt
|
|
{
|
|
public static int NewEntity(this ITemplate self, EcsWorld world)
|
|
{
|
|
int e = world.NewEmptyEntity();
|
|
self.Apply(world, e);
|
|
return e;
|
|
}
|
|
}
|
|
}
|