diff --git a/JNFrame2/Assembly-CSharp.csproj b/JNFrame2/Assembly-CSharp.csproj
index 1b39c8dc..498606ee 100644
--- a/JNFrame2/Assembly-CSharp.csproj
+++ b/JNFrame2/Assembly-CSharp.csproj
@@ -125,7 +125,7 @@
-
+
@@ -208,7 +208,7 @@
-
+
@@ -412,7 +412,7 @@
-
+
@@ -701,6 +701,8 @@
+
+
diff --git a/JNFrame2/Assets/JNGame/EntitasExtend/JNLookup.cs b/JNFrame2/Assets/JNGame/EntitasExtend/JNLookup.cs
index 37f63ad2..9bc59c22 100644
--- a/JNFrame2/Assets/JNGame/EntitasExtend/JNLookup.cs
+++ b/JNFrame2/Assets/JNGame/EntitasExtend/JNLookup.cs
@@ -10,7 +10,7 @@ namespace JNGame.EntitasExtend
private int _index = 0;
- public int Count => _index + 1;
+ public int Count => _index;
public int Next()
{
diff --git a/JNFrame2/Assets/JNGame/Map/DotRecast/DotRecastRoot.cs b/JNFrame2/Assets/JNGame/Map/DotRecast/DotRecastRoot.cs
index 90a7f9da..658991df 100644
--- a/JNFrame2/Assets/JNGame/Map/DotRecast/DotRecastRoot.cs
+++ b/JNFrame2/Assets/JNGame/Map/DotRecast/DotRecastRoot.cs
@@ -144,7 +144,8 @@ namespace JNGame.Map.DotRecast
//获取避障
public DtCrowdAgent GetAgent(ulong id)
{
- return agents[id];
+ agents.TryGetValue(id, out var value);
+ return value;
}
diff --git a/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgent.cs b/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgent.cs
index c4428a17..eecf5119 100644
--- a/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgent.cs
+++ b/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgent.cs
@@ -52,11 +52,16 @@ namespace DotRecast.Detour.Crowd
/// The desired speed.
public LFloat desiredSpeed;
- public RcVec3f npos = new RcVec3f(); // < The current agent position. [(x, y, z)]
- public RcVec3f disp = new RcVec3f(); // < A temporary value used to accumulate agent displacement during iterative collision resolution. [(x, y, z)]
- public RcVec3f dvel = new RcVec3f(); // < The desired velocity of the agent. Based on the current path, calculated from scratch each frame. [(x, y, z)]
- public RcVec3f nvel = new RcVec3f(); // < The desired velocity adjusted by obstacle avoidance, calculated from scratch each frame. [(x, y, z)]
- public RcVec3f vel = new RcVec3f(); // < The actual velocity of the agent. The change from nvel -> vel is constrained by max acceleration. [(x, y, z)]
+ // 当前代理的位置。这是一个三维向量,包含x、y、z坐标。
+ public RcVec3f npos = new RcVec3f();
+ // 一个临时值,用于在迭代碰撞解决过程中累积代理的位移。这也是一个三维向量,包含x、y、z方向的位移。
+ public RcVec3f disp = new RcVec3f();
+ // 代理的期望速度。这个速度基于当前路径,并且每帧都会重新计算。这是一个三维向量,表示x、y、z方向上的期望速度。
+ public RcVec3f dvel = new RcVec3f();
+ // 经过障碍物避让调整后的期望速度。这个速度也是每帧重新计算,并且考虑到了障碍物避免的逻辑。这是一个三维向量,表示调整后的x、y、z方向上的速度。
+ public RcVec3f nvel = new RcVec3f();
+ // 代理的实际速度。从nvel到vel的变化受到最大加速度的限制。这也是一个三维向量,表示x、y、z方向上的实际速度。
+ public RcVec3f vel = new RcVec3f();
/// The agent's configuration parameters.
public DtCrowdAgentParams option;
diff --git a/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgentState.cs b/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgentState.cs
index eda9251c..f6892e46 100644
--- a/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgentState.cs
+++ b/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtCrowdAgentState.cs
@@ -4,8 +4,8 @@
/// @ingroup crowd
public enum DtCrowdAgentState
{
- DT_CROWDAGENT_STATE_INVALID, // < The agent is not in a valid state.
- DT_CROWDAGENT_STATE_WALKING, // < The agent is traversing a normal navigation mesh polygon.
- DT_CROWDAGENT_STATE_OFFMESH, // < The agent is traversing an off-mesh connection.
+ DT_CROWDAGENT_STATE_INVALID, // < Agent 未处于有效状态。
+ DT_CROWDAGENT_STATE_WALKING, // < 代理正在遍历普通导航网格多边形。
+ DT_CROWDAGENT_STATE_OFFMESH, // < 代理正在遍历网格外连接。
};
}
\ No newline at end of file
diff --git a/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtMoveRequestState.cs b/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtMoveRequestState.cs
index 5bfc3297..53f152be 100644
--- a/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtMoveRequestState.cs
+++ b/JNFrame2/Assets/JNGame/Map/DotRecast/Src/DotRecast.Detour.Crowd/DtMoveRequestState.cs
@@ -2,12 +2,19 @@
{
public enum DtMoveRequestState
{
- DT_CROWDAGENT_TARGET_NONE,
- DT_CROWDAGENT_TARGET_FAILED,
- DT_CROWDAGENT_TARGET_VALID,
- DT_CROWDAGENT_TARGET_REQUESTING,
- DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,
- DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,
+ // 无目标状态
+ DT_CROWDAGENT_TARGET_NONE,
+ // 目标设置失败
+ DT_CROWDAGENT_TARGET_FAILED,
+ // 目标有效
+ DT_CROWDAGENT_TARGET_VALID,
+ // 正在请求目标
+ DT_CROWDAGENT_TARGET_REQUESTING,
+ // 正在等待队列处理
+ DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,
+ // 正在等待路径规划
+ DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,
+ // 正在以特定速度移动(可能指向目标或进行其他移动)
DT_CROWDAGENT_TARGET_VELOCITY,
};
}
\ No newline at end of file
diff --git a/JNFrame2/Assets/JNGame/Math/BaseType/LFloat.cs b/JNFrame2/Assets/JNGame/Math/BaseType/LFloat.cs
index 99e252f0..ef19f88e 100644
--- a/JNFrame2/Assets/JNGame/Math/BaseType/LFloat.cs
+++ b/JNFrame2/Assets/JNGame/Math/BaseType/LFloat.cs
@@ -111,6 +111,15 @@ namespace JNGame.Math
#endregion
+ public static LFloat Build1000(int val)
+ {
+ return new LFloat("", val);
+ }
+ public static LFloat Build(int val)
+ {
+ return new LFloat(val);
+ }
+
public LFloat SetInfinite(bool isInfinite)
{
this.isInfinite = 0;
@@ -614,6 +623,11 @@ namespace JNGame.Math
public static readonly LFloat EPS_1MS = new LFloat(null, 1L);
+ ///
+ /// 10
+ ///
+ public static readonly LFloat L1 = 1.ToLFloat();
+
///
/// 10
///
diff --git a/JNFrame2/Assets/JNGame/Plugins/Entitas/Editor/Entitas.VisualDebugging.Unity.Editor/src/EntitasHierarchyIcon.cs b/JNFrame2/Assets/JNGame/Plugins/Entitas/Editor/Entitas.VisualDebugging.Unity.Editor/src/EntitasHierarchyIcon.cs
index c326db9a..2ee437f8 100644
--- a/JNFrame2/Assets/JNGame/Plugins/Entitas/Editor/Entitas.VisualDebugging.Unity.Editor/src/EntitasHierarchyIcon.cs
+++ b/JNFrame2/Assets/JNGame/Plugins/Entitas/Editor/Entitas.VisualDebugging.Unity.Editor/src/EntitasHierarchyIcon.cs
@@ -170,10 +170,10 @@ namespace Entitas.VisualDebugging.Unity.Editor
var debugSystemsBehaviour = gameObject.GetComponent();
if (debugSystemsBehaviour != null)
{
- if (debugSystemsBehaviour.systems.executeDuration < _systemWarningThreshold)
- GUI.DrawTexture(rect, systemsHierarchyIcon);
- else
- GUI.DrawTexture(rect, systemsWarnHierarchyIcon);
+ // if (debugSystemsBehaviour.systems.executeDuration < _systemWarningThreshold)
+ // GUI.DrawTexture(rect, systemsHierarchyIcon);
+ // else
+ // GUI.DrawTexture(rect, systemsWarnHierarchyIcon);
}
}
}
diff --git a/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileContext.cs b/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileContext.cs
index 6c1cc37a..c5abf21a 100644
--- a/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileContext.cs
+++ b/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileContext.cs
@@ -11,9 +11,9 @@ namespace JNGame.Sync.State.Tile.Entity
public class JNTileContext : JNContext where T : JNTileEntity, new()
{
- private JNSSTileServerService SyncTile => base.Sync as JNSSTileServerService;
+ private JNSSTileServerService SyncTile => Sync as JNSSTileServerService;
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
foreach (var entity in base.GetEntities())
{
@@ -21,6 +21,10 @@ namespace JNGame.Sync.State.Tile.Entity
//生命周期
bool isContains = SyncTile.IsContains(entity.Position);
bool isHost = entity.IsHost;
+
+ //从服务器 如果数据不是自己创建的则自己永远没有权限
+ if (SyncTile.IsSlave && !(entity.IsSelfCreate)) isContains = false;
+
entity.IsHost = isContains;
//区块进入生命周期
@@ -37,28 +41,36 @@ namespace JNGame.Sync.State.Tile.Entity
//判断实体是否在所属区块 在则 更新
if (entity.IsHost)
{
- entity.OnSyncUpdate();
+ entity.OnSyncUpdate(dt);
}
}
}
+
+ public override T CreateEntity()
+ {
+ var entity = NewEntity();
+ BindInitialize(entity);
+ entity.IsHost = true;
+ entity.IsSelfCreate = true;
+ BindComponent(entity);
+ BindLifeCycle(entity);
+ return entity;
+ }
public T TileSyncCreate(ulong id)
{
-
//判断是否有这个Id实体
- foreach (var data in GetEntities())
+ if (Entities.ContainsKey(id))
{
- if (data.Id == id)
- {
- Debug.Log("重复Id实体创建");
- return null;
- }
+ Debug.Log("重复Id实体创建");
+ return null;
}
var entity = NewEntity();
entity.OnInit(this,id);
entity.IsHost = false;
+ entity.IsSelfCreate = false;
BindComponent(entity);
BindLifeCycle(entity);
return entity;
diff --git a/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileEntity.cs b/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileEntity.cs
index e0f692cb..8b47e9e4 100644
--- a/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileEntity.cs
+++ b/JNFrame2/Assets/JNGame/Sync/App/Tile/Entity/JNTileEntity.cs
@@ -43,13 +43,42 @@ namespace JNGame.Sync.State.Tile.Entity
///
public bool IsHost { get; set; } = false;
+ ///
+ /// 是否自己服务器创建
+ ///
+ public bool IsSelfCreate { get; set; } = false;
+
///
/// 是否将数据同步到从服务器
///
public bool IsSyncSlave { get; set; } = false;
///
- /// 是否将数据同步到主服务器
+ /// 是否将数据同步到主服务器 (目前没有这个场景 压根想不到这个场景使用所以遗弃)
+ /// 其中一个场景就是 主服务器的玩家要攻击从服务器的实体
+ /// 这个场景是不可能遇到的 因为 违背的设计
+ /// 1. 从服务器是用来解决主服务器实体多 导致同步流量高 而出现的解决方案
+ /// 如果将从服务器的实体同步到主服务器那么就违背了设计思路 导致主服务器流量增加
+ /// 2. 这种场景直接主服务器创建这个实体就可以了 没必要 从 从服务器里创建在同步给主服务器 多此一举
+ ///
+ /// 衍生问题 : 多人大乱斗的场景怎么办
+ /// 1. 主从服务器的模式并不能解决这个场景 主从服务器解决的场景有两种:
+ /// 1.主从服务器适用的场景是所有人攻击主服务器的某个实体 比如世界 Boss
+ /// 2.可以作为独立服务器存在 比如一个区块人满了 就创建一个独立的服务器
+ /// 让后面的人加入到新的服务器中 比如逆水寒右上角选择分场景 这时候的
+ /// 从服务器是不会和主服务器有任何交集的
+ /// 2. 如果要解决多人大乱斗的场景 怎么解决 ?
+ /// 1.解决这个问题的首先 要知道问题所在 问题的所在也是玩家多了之后同步
+ /// 的实体就会很多 怎么解决?
+ /// 2.这时候要引出另一种架构 主服务器 - [list]数据层服务器 - [list]玩家
+ /// 通过中间的数据层服务器去给玩家发送状态从而解决主服务器流量压力
+ /// 3.主服务器每次更新状态时候 将状态分别发送给 所有数据层服务器 有玩家
+ /// 加入就给玩家分配其中一个数据层服务器 通过这个数据层服务器 去同步
+ /// 数据
+ /// 4.当然 上面的是解决主服务压力 如果场景很多实体 会出现同步实体过多
+ /// 导致客户端接受到的状态数据非常多 从而客户端也有流量压力 所以这时候
+ /// 数据层服务器要增加一个功能 通过玩家位置 发送附近的状态数据 和 过滤
+ /// 指定实体来解决客户端流量压力 (这种优化点适用任何的状态同步)
///
public bool IsSyncMaster { get; set; } = false;
diff --git a/JNFrame2/Assets/JNGame/Sync/Entity/Component/Components/JNTransformComponent.cs b/JNFrame2/Assets/JNGame/Sync/Entity/Component/Components/JNTransformComponent.cs
index f541c6c7..38b1ef39 100644
--- a/JNFrame2/Assets/JNGame/Sync/Entity/Component/Components/JNTransformComponent.cs
+++ b/JNFrame2/Assets/JNGame/Sync/Entity/Component/Components/JNTransformComponent.cs
@@ -7,6 +7,13 @@ namespace JNGame.Sync.Frame.Entity.Component.Components
{
public class JNTransformComponent : JNComponent
{
+
public LVector3 Position = new();
+
+ public bool IsRange(LVector3 target,LFloat len)
+ {
+ return LVector3.Distance(Position, target) <= len;
+ }
+
}
}
\ No newline at end of file
diff --git a/JNFrame2/Assets/JNGame/Sync/Entity/Component/JNComponent.cs b/JNFrame2/Assets/JNGame/Sync/Entity/Component/JNComponent.cs
index 4036fdba..08b9b40c 100644
--- a/JNFrame2/Assets/JNGame/Sync/Entity/Component/JNComponent.cs
+++ b/JNFrame2/Assets/JNGame/Sync/Entity/Component/JNComponent.cs
@@ -24,7 +24,7 @@ namespace JNGame.Sync.Entity.Component
//生命周期
public virtual void OnSyncStart(){}
- public virtual void OnSyncUpdate(){}
+ public virtual void OnSyncUpdate(int dt){}
public virtual void OnSyncDestroy(){}
}
}
\ No newline at end of file
diff --git a/JNFrame2/Assets/JNGame/Sync/Entity/JNContext.cs b/JNFrame2/Assets/JNGame/Sync/Entity/JNContext.cs
index f2c7c2a1..e6ecd274 100644
--- a/JNFrame2/Assets/JNGame/Sync/Entity/JNContext.cs
+++ b/JNFrame2/Assets/JNGame/Sync/Entity/JNContext.cs
@@ -88,7 +88,7 @@ namespace JNGame.Sync.Frame.Entity
return entity;
}
- public sealed override T CreateEntity()
+ public override T CreateEntity()
{
var entity = NewEntity();
BindInitialize(entity);
@@ -100,14 +100,14 @@ namespace JNGame.Sync.Frame.Entity
//帧同步 生命周期
public virtual void OnSyncStart(){}
- public virtual void OnSyncUpdate()
+ public virtual void OnSyncUpdate(int dt)
{
//给实体推帧
foreach (var entity in GetEntities())
{
if (entity.isEnabled)
{
- entity.OnSyncUpdate();
+ entity.OnSyncUpdate(dt);
}
}
}
diff --git a/JNFrame2/Assets/JNGame/Sync/Entity/JNContexts.cs b/JNFrame2/Assets/JNGame/Sync/Entity/JNContexts.cs
index 6f60cdf7..8c83f118 100644
--- a/JNFrame2/Assets/JNGame/Sync/Entity/JNContexts.cs
+++ b/JNFrame2/Assets/JNGame/Sync/Entity/JNContexts.cs
@@ -23,7 +23,7 @@ namespace JNGame.Sync.Entity
{
for (var i = 0; i < allContexts.Length; i++)
{
- (allContexts[i] as IJNContext)?.OnSyncUpdate();
+ (allContexts[i] as IJNContext)?.OnSyncUpdate(Sync.DeltaTime);
}
}
diff --git a/JNFrame2/Assets/JNGame/Sync/Entity/JNEntity.cs b/JNFrame2/Assets/JNGame/Sync/Entity/JNEntity.cs
index ed4828b0..21886146 100644
--- a/JNFrame2/Assets/JNGame/Sync/Entity/JNEntity.cs
+++ b/JNFrame2/Assets/JNGame/Sync/Entity/JNEntity.cs
@@ -136,12 +136,12 @@ namespace JNGame.Sync.Entity
//生命周期
public virtual void OnSyncStart(){}
- public virtual void OnSyncUpdate()
+ public virtual void OnSyncUpdate(int dt)
{
//给组件推帧
foreach (var component in GetComponents())
{
- (component as JNComponent)?.OnSyncUpdate();
+ (component as JNComponent)?.OnSyncUpdate(dt);
}
}
diff --git a/JNFrame2/Assets/JNGame/Sync/IJNSyncCycle.cs b/JNFrame2/Assets/JNGame/Sync/IJNSyncCycle.cs
index 3803a54a..76bc10cc 100644
--- a/JNFrame2/Assets/JNGame/Sync/IJNSyncCycle.cs
+++ b/JNFrame2/Assets/JNGame/Sync/IJNSyncCycle.cs
@@ -14,7 +14,7 @@
///
/// 实体每帧刷新
///
- public void OnSyncUpdate();
+ public void OnSyncUpdate(int dt);
///
/// 实体销毁
diff --git a/JNFrame2/Assets/JNGame/Sync/JNSyncDefaultService.cs b/JNFrame2/Assets/JNGame/Sync/JNSyncDefaultService.cs
index 5dd79d5b..303d889c 100644
--- a/JNFrame2/Assets/JNGame/Sync/JNSyncDefaultService.cs
+++ b/JNFrame2/Assets/JNGame/Sync/JNSyncDefaultService.cs
@@ -116,13 +116,13 @@ namespace JNGame.Sync.Frame
if (syncSystemInfos[i].isActive){
var time = DateTime.Now.Ticks;
- _syncSystems[i].OnSyncUpdate();
+ _syncSystems[i].OnSyncUpdate(DeltaTime);
double time1 = (DateTime.Now.Ticks - time) / 10000f;
syncSystemInfos[i].AddSyncUpdateDuration(time1);
}
#else
- _syncSystems[i].OnSyncUpdate();
+ _syncSystems[i].OnSyncUpdate(DeltaTime);
#endif
}
diff --git a/JNFrame2/Assets/JNGame/Sync/System/Data/SFrameDataSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/Data/SFrameDataSystem.cs
index bbf011ce..502a43fc 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/Data/SFrameDataSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/Data/SFrameDataSystem.cs
@@ -7,7 +7,7 @@
public abstract class SFrameDataSystem : SDataSystem where T : ISData,new()
{
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
Data = GetLatest();
}
diff --git a/JNFrame2/Assets/JNGame/Sync/System/Data/SStateDataSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/Data/SStateDataSystem.cs
index 24381815..c86df20d 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/Data/SStateDataSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/Data/SStateDataSystem.cs
@@ -70,6 +70,9 @@ namespace JNGame.Sync.System.Data
public bool isServer => Type is SStateDataEnum.ServerClient or SStateDataEnum.Server;
public bool isClient => Type is SStateDataEnum.ServerClient or SStateDataEnum.Client;
+
+ //待插入的数据
+ private Queue> WaitUBytes = new ();
protected SStateDataSystem(SStateDataEnum type)
{
@@ -77,8 +80,12 @@ namespace JNGame.Sync.System.Data
}
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
+ while (WaitUBytes.Count > 0)
+ {
+ OnUByteUpdate(WaitUBytes.Dequeue());
+ }
//服务器: 发送最近数据
if (isServer)
@@ -125,8 +132,7 @@ namespace JNGame.Sync.System.Data
///
public void OnInsertUBytes(Dictionary bytes)
{
- //提交数据更新
- OnUByteUpdate(bytes);
+ WaitUBytes.Enqueue(bytes);
}
///
diff --git a/JNFrame2/Assets/JNGame/Sync/System/Data/STileDataSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/Data/STileDataSystem.cs
index 987420bb..82fb1def 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/Data/STileDataSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/Data/STileDataSystem.cs
@@ -78,6 +78,26 @@ namespace JNGame.Sync.System.Data
{
}
+ public override Dictionary GetLatest()
+ {
+ var nodes = new Dictionary();
+ E[] entities = null;
+ if (IsMaster)
+ {
+ entities = NodeContext.GetHostEntities();
+ }else if (IsSlave)
+ {
+ entities = NodeContext.GetEntities();
+ }
+ entities.ForEach(child =>
+ {
+ var entity = new T();
+ entity.BindEntity(child);
+ nodes.Add(child.Id,entity);
+ });
+ return nodes;
+ }
+
public override void OnUByteUpdate(Dictionary bytes)
{
base.OnUByteUpdate(bytes);
@@ -153,6 +173,9 @@ namespace JNGame.Sync.System.Data
foreach (var keyValue in lIsTileData)
{
var entity = NodeContext.TileSyncCreate(keyValue.Key);
+
+ //如果当前是从服务器则同步的实体都是 从 主服务器 同步给 从服务器
+ if (IsSlave) entity.IsSyncSlave = true;
entity?.TileSyncData(keyValue.Value);
//将实体绑定到数据中
keyValue.Value.BindEntity(entity);
@@ -164,13 +187,19 @@ namespace JNGame.Sync.System.Data
public override void Update(T data)
{
var entity = NodeContext.Query(data.Id);
- if (entity is null || !entity.IsHost) return;
+ if (IsMaster)
+ {
+ if (entity is null || !entity.IsHost) return;
+ }
base.Update(data);
}
public override void Add(T data)
{
var entity = NodeContext.Query(data.Id);
- if (entity is null || !entity.IsHost) return;
+ if (IsMaster)
+ {
+ if (entity is null || !entity.IsHost) return;
+ }
base.Add(data);
}
diff --git a/JNFrame2/Assets/JNGame/Sync/System/Logic/JNInputSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/Logic/JNInputSystem.cs
index 9f7826f7..2699b500 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/Logic/JNInputSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/Logic/JNInputSystem.cs
@@ -79,9 +79,9 @@ namespace JNGame.Sync.System.View
}
}
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
UpdateSInputs();
}
diff --git a/JNFrame2/Assets/JNGame/Sync/System/SDataSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/SDataSystem.cs
index 680e239a..67efa6c9 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/SDataSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/SDataSystem.cs
@@ -41,7 +41,7 @@ namespace JNGame.Sync.System
{
public abstract void OnSyncStart();
- public abstract void OnSyncUpdate();
+ public abstract void OnSyncUpdate(int dt);
public virtual void OnSyncDestroy()
{ }
diff --git a/JNFrame2/Assets/JNGame/Sync/System/SLogicSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/SLogicSystem.cs
index c8dfd9ea..7172faaf 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/SLogicSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/SLogicSystem.cs
@@ -23,7 +23,7 @@ namespace JNGame.Sync.System
}
- public virtual void OnSyncUpdate()
+ public virtual void OnSyncUpdate(int dt)
{
}
diff --git a/JNFrame2/Assets/JNGame/Sync/System/SViewSystem.cs b/JNFrame2/Assets/JNGame/Sync/System/SViewSystem.cs
index 801ac411..e22b3a9c 100644
--- a/JNFrame2/Assets/JNGame/Sync/System/SViewSystem.cs
+++ b/JNFrame2/Assets/JNGame/Sync/System/SViewSystem.cs
@@ -12,7 +12,7 @@ namespace JNGame.Sync.System
public virtual void OnSyncStart()
{
}
- public virtual void OnSyncUpdate()
+ public virtual void OnSyncUpdate(int dt)
{
}
public virtual void OnSyncDestroy()
diff --git a/JNFrame2/Assets/Scripts/Game/Data/EDBossDataSystem.cs b/JNFrame2/Assets/Scripts/Game/Data/EDBossDataSystem.cs
index 178c429f..11db69b9 100644
--- a/JNFrame2/Assets/Scripts/Game/Data/EDBossDataSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Data/EDBossDataSystem.cs
@@ -2,6 +2,7 @@
using DotRecast.Core.Collections;
using Game.JNGFrame.Logic.Entity;
using Game.JNGFrame.Logic.Entity.Contexts;
+using Game.Logic.Entity.Nodes;
using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System.Data;
using UnityEngine;
diff --git a/JNFrame2/Assets/Scripts/Game/Data/EDNodeDataSystem.cs b/JNFrame2/Assets/Scripts/Game/Data/EDNodeDataSystem.cs
index 1bb5d2db..b9c308a4 100644
--- a/JNFrame2/Assets/Scripts/Game/Data/EDNodeDataSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Data/EDNodeDataSystem.cs
@@ -6,6 +6,7 @@ using DotRecast.Core.Collections;
using Entitas;
using Game.JNGFrame.Logic.Entity;
using Game.JNGFrame.Logic.Entity.Contexts;
+using Game.Logic.Entity.Nodes;
using JNGame.Math;
using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System;
diff --git a/JNFrame2/Assets/Scripts/Game/Data/EDPlayerDataSystem.cs b/JNFrame2/Assets/Scripts/Game/Data/EDPlayerDataSystem.cs
index db1260ea..d4fadd49 100644
--- a/JNFrame2/Assets/Scripts/Game/Data/EDPlayerDataSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Data/EDPlayerDataSystem.cs
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using DotRecast.Core.Collections;
using Game.JNGFrame.Logic.Entity;
using Game.JNGFrame.Logic.Entity.Contexts;
+using Game.Logic.Entity.Nodes;
using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System;
using JNGame.Sync.System.Data;
diff --git a/JNFrame2/Assets/Scripts/Game/Data/GDataBaseSystem.cs b/JNFrame2/Assets/Scripts/Game/Data/GDataBaseSystem.cs
index 302e344d..7c63b5e7 100644
--- a/JNFrame2/Assets/Scripts/Game/Data/GDataBaseSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Data/GDataBaseSystem.cs
@@ -114,18 +114,6 @@ namespace Game.JNGState.Logic.Data
protected GDataBaseSystem(SStateDataEnum type) : base(type)
{
}
-
- public override Dictionary GetLatest()
- {
- var nodes = new Dictionary();
- NodeContext.GetHostEntities().ForEach(child =>
- {
- var entity = new T();
- entity.BindEntity(child);
- nodes.Add(child.Id,entity);
- });
- return nodes;
- }
public override void OnSendAllData(Dictionary bytes)
{
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/EDEntityBasis.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/EDEntityBasis.cs
new file mode 100644
index 00000000..4c184473
--- /dev/null
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/EDEntityBasis.cs
@@ -0,0 +1,30 @@
+using JNGame.Math;
+using JNGame.Sync.Frame.Service;
+using JNGame.Sync.State.Tile;
+using JNGame.Sync.State.Tile.Entity;
+
+namespace Game.Logic.Entity
+{
+ public abstract class EDEntityBasis : JNTileEntity
+ {
+
+ public JNRandomSystem Random => Context.GetSync().GetSystem();
+
+ //获取当前权限瓦块随机点
+ public LVector3 GetTileRandom()
+ {
+
+ if (Context.GetSync() is JNSSTileServerService tileServer)
+ {
+ return new LVector3(
+ Random.Float(tileServer.MinContains.x,tileServer.MaxContains.x),
+ LFloat.Zero,
+ Random.Float(tileServer.MinContains.y,tileServer.MaxContains.y)
+ );
+ }
+ return LVector3.Down;
+ }
+
+
+ }
+}
\ No newline at end of file
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/EDEntityBasis.cs.meta b/JNFrame2/Assets/Scripts/Game/Logic/Entity/EDEntityBasis.cs.meta
new file mode 100644
index 00000000..abfc63a1
--- /dev/null
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/EDEntityBasis.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: b0f4f8b42fdc465b9ad60b8e574aa996
+timeCreated: 1725096772
\ No newline at end of file
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Components/EDMoveComponent.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Components/EDMoveComponent.cs
index bdce911f..3cf679f7 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Components/EDMoveComponent.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Components/EDMoveComponent.cs
@@ -1,15 +1,14 @@
-using DotRecast.Detour.Crowd;
+using System;
+using DotRecast.Detour.Crowd;
using Game.Logic.System.Usual;
using JNGame.Math;
-using JNGame.Sync.Entity.Component;
-using JNGame.Sync.State.Tile.Entity.Component;
-namespace Game.JNGFrame.Logic.Entity.Components
+namespace Game.Logic.Entity.Nodes.Component.Components
{
///
/// 移动组件
///
- public class EDMoveComponent : JNTileComponent
+ public class EDMoveComponent : EDEntityComponent
{
public DMapSystem Map => GetSystem();
@@ -34,6 +33,16 @@ namespace Game.JNGFrame.Logic.Entity.Components
_info.maxAcceleration = _info.maxSpeed * 4;
}
}
+
+ public LVector3 MoveTarget
+ {
+ get
+ {
+ DtCrowdAgent agent = Map.GetAgent(Entity.Id);
+ if (agent is null) return LVector3.Zero;
+ return new LVector3(agent.targetPos.X,agent.targetPos.Y,agent.targetPos.Z);
+ }
+ }
public override void OnSyncStart()
{
@@ -98,11 +107,19 @@ namespace Game.JNGFrame.Logic.Entity.Components
Map.VectorMoveAgent(Entity.Id, vector * Speed);
}
- public override void OnSyncUpdate()
+ public bool IsNearTarget()
{
- base.OnSyncUpdate();
+ if (MoveTarget == LVector3.Zero) return true;
+ DtCrowdAgent agent = Map.GetAgent(Entity.Id);
+ return EntityBasis.Transform.IsRange(MoveTarget, LFloat.L1 + agent.option.radius);
+ }
+
+ public override void OnSyncUpdate(int dt)
+ {
+ base.OnSyncUpdate(dt);
var npos = Map.GetAgent(Entity.Id).npos;
Entity.Transform.Position = new LVector3((LFloat)npos.X, (LFloat)npos.Y, (LFloat)npos.Z);
+
}
public override void OnSyncDestroy()
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDBossController.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDBossController.cs
index e215a26a..5176eea2 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDBossController.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDBossController.cs
@@ -1,5 +1,6 @@
-using Game.Input;
-using Game.JNGFrame.Logic.Entity.Components;
+using Game.Logic.Entity;
+using Game.Logic.Entity.Nodes.Component;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Math;
using JNGame.Sync.State.Tile.Entity.Component;
@@ -8,14 +9,35 @@ namespace Game.JNGFrame.Logic.Entity.Controller
///
/// Boss控制器
///
- public class EDBossController : JNTileComponent
+ public class EDBossController : EDEntityComponent
{
+
+ public EDMoveComponent Move => Entity.GetComponent();
+
public override void OnSyncStart()
{
+
base.OnSyncStart();
//Boss 同步到从服务器
TileEntity.IsSyncSlave = true;
+
+ Move.Speed = LFloat.L10;
+
}
+
+ public override void OnSyncUpdate(int dt)
+ {
+
+ base.OnSyncUpdate(dt);
+
+ // 到达目标则移动
+ if (Move.IsNearTarget())
+ {
+ Move.Go(EntityBasis.GetTileRandom());
+ }
+
+ }
+
}
}
\ No newline at end of file
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDPlayerController.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDPlayerController.cs
index f2d70024..57601c11 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDPlayerController.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Controller/EDPlayerController.cs
@@ -1,14 +1,14 @@
using Game.Input;
-using Game.JNGFrame.Logic.Entity.Components;
+using Game.Logic.Entity.Nodes.Component;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Math;
-using JNGame.Sync.State.Tile.Entity.Component;
namespace Game.JNGFrame.Logic.Entity.Controller
{
///
/// 角色控制器
///
- public class EDPlayerController : JNTileComponent
+ public class EDPlayerController : EDEntityComponent
{
///
@@ -37,9 +37,9 @@ namespace Game.JNGFrame.Logic.Entity.Controller
Move.Speed = LFloat.L10;
}
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
OnMoveUpdate();
}
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDEntityComponent.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDEntityComponent.cs
new file mode 100644
index 00000000..675e1f6c
--- /dev/null
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDEntityComponent.cs
@@ -0,0 +1,11 @@
+using JNGame.Sync.State.Tile.Entity.Component;
+
+namespace Game.Logic.Entity.Nodes.Component
+{
+ public class EDEntityComponent : JNTileComponent
+ {
+
+ public EDEntityBasis EntityBasis => Entity as EDEntityBasis;
+
+ }
+}
\ No newline at end of file
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDEntityComponent.cs.meta b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDEntityComponent.cs.meta
new file mode 100644
index 00000000..052108fd
--- /dev/null
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDEntityComponent.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: c880d909098c44d59b5ec8d009dc1fe4
+timeCreated: 1725097481
\ No newline at end of file
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup.meta b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup.meta
new file mode 100644
index 00000000..92702f3f
--- /dev/null
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 835547007d6f4d88a441f5c4e782b103
+timeCreated: 1725097492
\ No newline at end of file
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDBossLookup.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDBossLookup.cs
similarity index 87%
rename from JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDBossLookup.cs
rename to JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDBossLookup.cs
index d500bd1b..27588e74 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDBossLookup.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDBossLookup.cs
@@ -1,9 +1,10 @@
using System;
using Game.JNGFrame.Logic.Entity.Controller;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Util.Types;
-namespace Game.JNGFrame.Logic.Entity.Components
+namespace Game.Logic.Entity.Nodes.Component.Lookup
{
public class EDBoosLookup : JNEntityLookup
{
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDBossLookup.cs.meta b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDBossLookup.cs.meta
similarity index 100%
rename from JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDBossLookup.cs.meta
rename to JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDBossLookup.cs.meta
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDNodeLookup.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDNodeLookup.cs
similarity index 83%
rename from JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDNodeLookup.cs
rename to JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDNodeLookup.cs
index f1649a9c..1c25965f 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDNodeLookup.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDNodeLookup.cs
@@ -1,8 +1,9 @@
using System;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Util.Types;
-namespace Game.JNGFrame.Logic.Entity.Components
+namespace Game.Logic.Entity.Nodes.Component.Lookup
{
public class EDNodeLookup : JNEntityLookup
{
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDNodeLookup.cs.meta b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDNodeLookup.cs.meta
similarity index 100%
rename from JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDNodeLookup.cs.meta
rename to JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDNodeLookup.cs.meta
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDPlayerLookup.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDPlayerLookup.cs
similarity index 87%
rename from JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDPlayerLookup.cs
rename to JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDPlayerLookup.cs
index cc9bb67d..93a8aed0 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDPlayerLookup.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDPlayerLookup.cs
@@ -1,10 +1,10 @@
using System;
using Game.JNGFrame.Logic.Entity.Controller;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Util.Types;
-using UnityEngine;
-namespace Game.JNGFrame.Logic.Entity.Components
+namespace Game.Logic.Entity.Nodes.Component.Lookup
{
public class EDPlayerLookup : JNEntityLookup
{
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDPlayerLookup.cs.meta b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDPlayerLookup.cs.meta
similarity index 100%
rename from JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/EDPlayerLookup.cs.meta
rename to JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Component/Lookup/EDPlayerLookup.cs.meta
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDBossContext.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDBossContext.cs
index 59c95ff0..9b0aa295 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDBossContext.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDBossContext.cs
@@ -1,5 +1,6 @@
-using Game.JNGFrame.Logic.Entity.Components;
-using Game.JNGFrame.Logic.Entity.Controller;
+using Game.JNGFrame.Logic.Entity.Controller;
+using Game.Logic.Entity.Nodes;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Sync.Frame.Entity;
using JNGame.Sync.State.Tile.Entity;
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDNodeContext.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDNodeContext.cs
index a761313b..631eccdd 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDNodeContext.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDNodeContext.cs
@@ -1,4 +1,5 @@
-using Game.JNGFrame.Logic.Entity.Components;
+using Game.Logic.Entity.Nodes;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Sync.Frame.Entity;
using JNGame.Sync.State.Tile.Entity;
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDPlayerContext.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDPlayerContext.cs
index 1a8ea776..200b0845 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDPlayerContext.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/Contexts/EDPlayerContext.cs
@@ -1,5 +1,6 @@
-using Game.JNGFrame.Logic.Entity.Components;
-using Game.JNGFrame.Logic.Entity.Controller;
+using Game.JNGFrame.Logic.Entity.Controller;
+using Game.Logic.Entity.Nodes;
+using Game.Logic.Entity.Nodes.Component.Components;
using JNGame.Sync.State.Tile.Entity;
namespace Game.JNGFrame.Logic.Entity.Contexts
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDBoss.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDBoss.cs
index 06aa8e9e..f099029e 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDBoss.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDBoss.cs
@@ -1,14 +1,13 @@
-using Game.JNGFrame.Logic.Entity.Components;
-using Game.JNGFrame.Logic.Entity.Controller;
+using Game.JNGFrame.Logic.Entity.Controller;
using Game.JNGState.Logic.Data;
+using Game.Logic.Entity.Nodes.Component.Components;
+using Game.Logic.Entity.Nodes.Component.Lookup;
using JNGame.Sync.Frame.Entity.Components;
-using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System.Data;
-using NotImplementedException = System.NotImplementedException;
-namespace Game.JNGFrame.Logic.Entity
+namespace Game.Logic.Entity.Nodes
{
- public class EDBoss : JNTileEntity
+ public class EDBoss : EDEntityBasis
{
public EDMoveComponent Move => CLookup.Query(this);
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDNode.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDNode.cs
index 9dc54fa0..7f8b2ba6 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDNode.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDNode.cs
@@ -1,13 +1,13 @@
-using Game.JNGFrame.Logic.Entity.Components;
-using Game.JNGState.Logic.Data;
+using Game.JNGState.Logic.Data;
+using Game.Logic.Entity.Nodes.Component.Components;
+using Game.Logic.Entity.Nodes.Component.Lookup;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System.Data;
-using NotImplementedException = System.NotImplementedException;
-namespace Game.JNGFrame.Logic.Entity
+namespace Game.Logic.Entity.Nodes
{
- public class EDNode : JNTileEntity
+ public class EDNode : EDEntityBasis
{
public EDMoveComponent Move => CLookup.Query(this);
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDPlayer.cs b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDPlayer.cs
index 28f3bf51..37727cf3 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDPlayer.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDPlayer.cs
@@ -1,15 +1,14 @@
-using Game.JNGFrame.Logic.Entity.Components;
-using Game.JNGFrame.Logic.Entity.Controller;
+using Game.JNGFrame.Logic.Entity.Controller;
using Game.JNGState.Logic.Data;
-using JNGame.Math;
+using Game.Logic.Entity.Nodes.Component.Components;
+using Game.Logic.Entity.Nodes.Component.Lookup;
using JNGame.Sync.Frame.Entity.Components;
using JNGame.Sync.State.Tile.Entity;
using JNGame.Sync.System.Data;
-using NotImplementedException = System.NotImplementedException;
-namespace Game.JNGFrame.Logic.Entity
+namespace Game.Logic.Entity.Nodes
{
- public class EDPlayer : JNTileEntity
+ public class EDPlayer : EDEntityBasis
{
public EDMoveComponent Move => CLookup.Query(this);
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DBossSystem.cs b/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DBossSystem.cs
index 33e7885e..32042822 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DBossSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DBossSystem.cs
@@ -2,6 +2,7 @@
using Game.Input;
using Game.JNGFrame.Logic.Entity;
using Game.JNGFrame.Logic.Entity.Contexts;
+using Game.Logic.Entity.Nodes;
using JNGame.Math;
namespace Game.Logic.System.Logic
@@ -18,9 +19,9 @@ namespace Game.Logic.System.Logic
public DInputSystem Input => GetSystem();
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
//创建Boss
GetSystem().SInput().ForEach(child =>
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DPlayerSystem.cs b/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DPlayerSystem.cs
index e4491783..d4f34602 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DPlayerSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DPlayerSystem.cs
@@ -2,6 +2,7 @@
using Game.Input;
using Game.JNGFrame.Logic.Entity;
using Game.JNGFrame.Logic.Entity.Contexts;
+using Game.Logic.Entity.Nodes;
using JNGame.Math;
namespace Game.Logic.System.Logic
@@ -18,9 +19,9 @@ namespace Game.Logic.System.Logic
public DInputSystem Input => GetSystem();
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
//创建角色
GetSystem().SInput().ForEach(child =>
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DWorldSystem.cs b/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DWorldSystem.cs
index d2aad40c..f8216100 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DWorldSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/System/Logic/DWorldSystem.cs
@@ -2,6 +2,7 @@
using Game.Input;
using Game.JNGFrame.Logic.Entity;
using Game.JNGFrame.Logic.Entity.Contexts;
+using Game.Logic.Entity.Nodes;
using JNGame.Math;
namespace Game.Logic.System.Logic
@@ -16,10 +17,10 @@ namespace Game.Logic.System.Logic
//Node 第一个节点
public Queue NodeQueue = new();
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
if (GetSystem().SInputOne() is not IDWorld { IsAdd: true }) return;
//超过500 则 销毁第一个实体
diff --git a/JNFrame2/Assets/Scripts/Game/Logic/System/Usual/DMapSystem.cs b/JNFrame2/Assets/Scripts/Game/Logic/System/Usual/DMapSystem.cs
index 50ef5c9d..d5b6cd22 100644
--- a/JNFrame2/Assets/Scripts/Game/Logic/System/Usual/DMapSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/Logic/System/Usual/DMapSystem.cs
@@ -23,9 +23,9 @@ namespace Game.Logic.System.Usual
Debug.Log($"DemoMapService - 加载完成地图");
}
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
Root.Update(new LFloat(null,Sync.DeltaTime));
}
diff --git a/JNFrame2/Assets/Scripts/Game/View/DViewSystem.cs b/JNFrame2/Assets/Scripts/Game/View/DViewSystem.cs
index ac08eb6f..a08bc816 100644
--- a/JNFrame2/Assets/Scripts/Game/View/DViewSystem.cs
+++ b/JNFrame2/Assets/Scripts/Game/View/DViewSystem.cs
@@ -18,9 +18,9 @@ namespace Game.JNGFrame.View
};
}
- public override void OnSyncUpdate()
+ public override void OnSyncUpdate(int dt)
{
- base.OnSyncUpdate();
+ base.OnSyncUpdate(dt);
foreach (var view in views)
{
view.Execute();