mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
30 lines
742 B
C#
30 lines
742 B
C#
using Entitas;
|
|
using JNGame.Sync.System;
|
|
using NotImplementedException = System.NotImplementedException;
|
|
|
|
namespace JNGame.Sync.Entity.Component
|
|
{
|
|
/// <summary>
|
|
/// 组件
|
|
/// </summary>
|
|
public class JNComponent : IComponent,IJNSyncCycle
|
|
{
|
|
|
|
public IJNEntity Entity;
|
|
|
|
public void OnInit(IJNEntity entity)
|
|
{
|
|
this.Entity = entity;
|
|
}
|
|
|
|
public T GetSystem<T>() where T : SLogicSystem
|
|
{
|
|
return Entity.GetContext().GetSync().GetSystem<T>();
|
|
}
|
|
|
|
//生命周期
|
|
public virtual void OnSyncStart(){}
|
|
public virtual void OnSyncUpdate(int dt){}
|
|
public virtual void OnSyncDestroy(){}
|
|
}
|
|
} |