mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交新概念 Tile从服务器
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using Entitas;
|
||||
using Game.JNGFrame.Logic.Entity.Contexts;
|
||||
using JNGame.Sync.Entity;
|
||||
using JNGame.Sync.Frame.Entity;
|
||||
using JNGame.Sync.State.Tile.Entity;
|
||||
|
||||
namespace Game.JNGFrame.Logic.Entity
|
||||
@@ -9,7 +7,7 @@ namespace Game.JNGFrame.Logic.Entity
|
||||
public class EDContexts : JNTileContexts
|
||||
{
|
||||
|
||||
public override IContext[] allContexts { get; } = { new EDNodeContext(),new EDPlayerContext() };
|
||||
public override IContext[] allContexts { get; } = { new EDNodeContext(),new EDPlayerContext(),new EDBossContext(), };
|
||||
|
||||
}
|
||||
}
|
@@ -1,5 +1,5 @@
|
||||
using DotRecast.Detour.Crowd;
|
||||
using Game.JNGFrame.Logic.System;
|
||||
using Game.Logic.System.Usual;
|
||||
using JNGame.Math;
|
||||
using JNGame.Sync.Entity.Component;
|
||||
using JNGame.Sync.State.Tile.Entity.Component;
|
||||
|
@@ -0,0 +1,21 @@
|
||||
using Game.Input;
|
||||
using Game.JNGFrame.Logic.Entity.Components;
|
||||
using JNGame.Math;
|
||||
using JNGame.Sync.State.Tile.Entity.Component;
|
||||
|
||||
namespace Game.JNGFrame.Logic.Entity.Controller
|
||||
{
|
||||
/// <summary>
|
||||
/// Boss控制器
|
||||
/// </summary>
|
||||
public class EDBossController : JNTileComponent
|
||||
{
|
||||
public override void OnSyncStart()
|
||||
{
|
||||
base.OnSyncStart();
|
||||
|
||||
//Boss 同步到从服务器
|
||||
TileEntity.IsSyncSlave = true;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3e21eba1a90402cbcf1c142b7c6b103
|
||||
timeCreated: 1724723406
|
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using Game.JNGFrame.Logic.Entity.Controller;
|
||||
using JNGame.Sync.Frame.Entity.Components;
|
||||
using JNGame.Util.Types;
|
||||
|
||||
namespace Game.JNGFrame.Logic.Entity.Components
|
||||
{
|
||||
public class EDBoosLookup : JNEntityLookup
|
||||
{
|
||||
|
||||
//移动组件
|
||||
public int Movement { get; set; }
|
||||
public int Controller { get; set; }
|
||||
|
||||
protected override void BindIndex()
|
||||
{
|
||||
base.BindIndex();
|
||||
Movement = Next();
|
||||
Controller = Next();
|
||||
}
|
||||
|
||||
protected override void BindType(KeyValue<int, Type> types)
|
||||
{
|
||||
base.BindType(types);
|
||||
types.Add(Movement,typeof(EDMoveComponent));
|
||||
types.Add(Controller,typeof(EDBossController));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3000f079bc5f4d72aa5d6b4145ac5e0e
|
||||
timeCreated: 1724723017
|
@@ -0,0 +1,18 @@
|
||||
using Game.JNGFrame.Logic.Entity.Components;
|
||||
using Game.JNGFrame.Logic.Entity.Controller;
|
||||
using JNGame.Sync.Frame.Entity;
|
||||
using JNGame.Sync.State.Tile.Entity;
|
||||
|
||||
namespace Game.JNGFrame.Logic.Entity.Contexts
|
||||
{
|
||||
public sealed partial class EDBossContext : JNTileContext<EDBoss>
|
||||
{
|
||||
protected override EDBoss BindComponent(EDBoss entity)
|
||||
{
|
||||
base.BindComponent(entity);
|
||||
entity.AddComponent<EDMoveComponent>();
|
||||
entity.AddComponent<EDBossController>();
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dae9cf4b44914450b1624b40d7646190
|
||||
timeCreated: 1724723007
|
29
JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDBoss.cs
Normal file
29
JNFrame2/Assets/Scripts/Game/Logic/Entity/Nodes/EDBoss.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Game.JNGFrame.Logic.Entity.Components;
|
||||
using Game.JNGFrame.Logic.Entity.Controller;
|
||||
using Game.JNGState.Logic.Data;
|
||||
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
|
||||
{
|
||||
public class EDBoss : JNTileEntity
|
||||
{
|
||||
|
||||
public EDMoveComponent Move => CLookup.Query<EDMoveComponent>(this);
|
||||
public EDBossController Controller => CLookup.Query<EDBossController>(this);
|
||||
|
||||
public override void TileSyncData(ISTileData data)
|
||||
{
|
||||
var nodeData = data as EDBossData;
|
||||
Transform.Position = nodeData.Value.Position.ToLVector3();
|
||||
}
|
||||
|
||||
public override JNEntityLookup NewCLookup()
|
||||
{
|
||||
return new EDBoosLookup();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 473e297b1bcf4ff1ad73d3fd1de8c597
|
||||
timeCreated: 1724675433
|
@@ -23,5 +23,6 @@ namespace Game.JNGFrame.Logic.Entity
|
||||
{
|
||||
return new EDNodeLookup();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user