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:
72
Assets/GameScripts/DotNet/Model/Share/LockStep/LSEntity.cs
Normal file
72
Assets/GameScripts/DotNet/Model/Share/LockStep/LSEntity.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
using System;
|
||||
|
||||
namespace ET
|
||||
{
|
||||
public interface IRegisterLSEntitySystem
|
||||
{
|
||||
void RegisterSystem(LSEntity entity);
|
||||
}
|
||||
|
||||
[EnableMethod]
|
||||
public class LSEntity: Entity
|
||||
{
|
||||
public new K AddComponent<K>(bool isFromPool = false) where K : LSEntity, IAwake, new()
|
||||
{
|
||||
return this.AddComponentWithId<K>(this.GetId(), isFromPool);
|
||||
}
|
||||
|
||||
public new K AddComponent<K, P1>(P1 p1, bool isFromPool = false) where K : LSEntity, IAwake<P1>, new()
|
||||
{
|
||||
return this.AddComponentWithId<K, P1>(this.GetId(), p1, isFromPool);
|
||||
}
|
||||
|
||||
public new K AddComponent<K, P1, P2>(P1 p1, P2 p2, bool isFromPool = false) where K : LSEntity, IAwake<P1, P2>, new()
|
||||
{
|
||||
return this.AddComponentWithId<K, P1, P2>(this.GetId(), p1, p2, isFromPool);
|
||||
}
|
||||
|
||||
public new K AddComponent<K, P1, P2, P3>(P1 p1, P2 p2, P3 p3, bool isFromPool = false) where K : LSEntity, IAwake<P1, P2, P3>, new()
|
||||
{
|
||||
return this.AddComponentWithId<K, P1, P2, P3>(this.GetId(), p1, p2, p3, isFromPool);
|
||||
}
|
||||
|
||||
[EnableAccessEntiyChild]
|
||||
public new T AddChild<T>(bool isFromPool = false) where T : LSEntity, IAwake
|
||||
{
|
||||
return this.AddChildWithId<T>(this.GetId(), isFromPool);
|
||||
}
|
||||
|
||||
[EnableAccessEntiyChild]
|
||||
public new T AddChild<T, A>(A a, bool isFromPool = false) where T : LSEntity, IAwake<A>
|
||||
{
|
||||
return this.AddChildWithId<T, A>(this.GetId(), a, isFromPool);
|
||||
}
|
||||
|
||||
[EnableAccessEntiyChild]
|
||||
public new T AddChild<T, A, B>(A a, B b, bool isFromPool = false) where T : LSEntity, IAwake<A, B>
|
||||
{
|
||||
return this.AddChildWithId<T, A, B>(this.GetId(), a, b, isFromPool);
|
||||
}
|
||||
|
||||
[EnableAccessEntiyChild]
|
||||
public new T AddChild<T, A, B, C>(A a, B b, C c, bool isFromPool = false) where T : LSEntity, IAwake<A, B, C>
|
||||
{
|
||||
return this.AddChildWithId<T, A, B, C>(this.GetId(), a, b, c, isFromPool);
|
||||
}
|
||||
|
||||
protected override void RegisterSystem()
|
||||
{
|
||||
IRegisterLSEntitySystem iRegisterLsEntitySystem = (IRegisterLSEntitySystem)this.IScene;
|
||||
TypeSystems.OneTypeSystems oneTypeSystems = LSEntitySystemSingleton.Instance.GetOneTypeSystems(this.GetType());
|
||||
if (oneTypeSystems == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (oneTypeSystems.QueueFlag[LSQueneUpdateIndex.LSUpdate])
|
||||
{
|
||||
iRegisterLsEntitySystem.RegisterSystem(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user