提交新概念 Tile从服务器

This commit is contained in:
PC-20230316NUNE\Administrator
2024-08-31 15:35:12 +08:00
parent 77db4d7d71
commit d67032e1de
1039 changed files with 57738 additions and 412 deletions

View File

@@ -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(), };
}
}

View File

@@ -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;

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b3e21eba1a90402cbcf1c142b7c6b103
timeCreated: 1724723406

View File

@@ -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));
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3000f079bc5f4d72aa5d6b4145ac5e0e
timeCreated: 1724723017

View File

@@ -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;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: dae9cf4b44914450b1624b40d7646190
timeCreated: 1724723007

View 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();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 473e297b1bcf4ff1ad73d3fd1de8c597
timeCreated: 1724675433

View File

@@ -23,5 +23,6 @@ namespace Game.JNGFrame.Logic.Entity
{
return new EDNodeLookup();
}
}
}