mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] 接入ET8服务端
[+] 接入ET8服务端
This commit is contained in:
39
Assets/GameScripts/DotNet/Core/Entity/IAddComponentSystem.cs
Normal file
39
Assets/GameScripts/DotNet/Core/Entity/IAddComponentSystem.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public interface IAddComponent
|
||||
{
|
||||
}
|
||||
|
||||
public interface IAddComponentSystem: ISystemType
|
||||
{
|
||||
void Run(Entity o, Entity component);
|
||||
}
|
||||
|
||||
[EntitySystem]
|
||||
public abstract class AddComponentSystem<T> : IAddComponentSystem where T: Entity, IAddComponent
|
||||
{
|
||||
void IAddComponentSystem.Run(Entity o, Entity component)
|
||||
{
|
||||
this.AddComponent((T)o, component);
|
||||
}
|
||||
|
||||
Type ISystemType.SystemType()
|
||||
{
|
||||
return typeof(IAddComponentSystem);
|
||||
}
|
||||
|
||||
int ISystemType.GetInstanceQueueIndex()
|
||||
{
|
||||
return InstanceQueueIndex.None;
|
||||
}
|
||||
|
||||
Type ISystemType.Type()
|
||||
{
|
||||
return typeof(T);
|
||||
}
|
||||
|
||||
protected abstract void AddComponent(T self, Entity component);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user