Files
TEngine/Assets/GameScripts/DotNet/Core/Entity/IDestroySystem.cs
ALEXTANG 336d4b2eb9 [+] 接入ET8服务端
[+] 接入ET8服务端
2023-07-13 12:23:48 +08:00

40 lines
578 B
C#

using System;
namespace ET
{
public interface IDestroy
{
}
public interface IDestroySystem: ISystemType
{
void Run(Entity o);
}
[EntitySystem]
public abstract class DestroySystem<T> : IDestroySystem where T: Entity, IDestroy
{
void IDestroySystem.Run(Entity o)
{
this.Destroy((T)o);
}
Type ISystemType.SystemType()
{
return typeof(IDestroySystem);
}
int ISystemType.GetInstanceQueueIndex()
{
return InstanceQueueIndex.None;
}
Type ISystemType.Type()
{
return typeof(T);
}
protected abstract void Destroy(T self);
}
}