mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交新概念 Tile从服务器
This commit is contained in:
3
JNFrame2/Assets/Scripts/Game/Logic/System/Logic.meta
Normal file
3
JNFrame2/Assets/Scripts/Game/Logic/System/Logic.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: babf7d8ac075441b803a0078da31ce8a
|
||||
timeCreated: 1724724193
|
@@ -0,0 +1,40 @@
|
||||
using DotRecast.Core.Collections;
|
||||
using Game.Input;
|
||||
using Game.JNGFrame.Logic.Entity;
|
||||
using Game.JNGFrame.Logic.Entity.Contexts;
|
||||
using JNGame.Math;
|
||||
|
||||
namespace Game.Logic.System.Logic
|
||||
{
|
||||
/// <summary>
|
||||
/// Boss逻辑
|
||||
/// </summary>
|
||||
public class DBossSystem : DGBasisSystem
|
||||
{
|
||||
|
||||
//Node 节点
|
||||
public EDBoss[] Nodes => NodeContext.GetHostEntities();
|
||||
public EDBossContext NodeContext => Contexts.GetContext<EDBossContext>();
|
||||
|
||||
public DInputSystem Input => GetSystem<DInputSystem>();
|
||||
|
||||
public override void OnSyncUpdate()
|
||||
{
|
||||
base.OnSyncUpdate();
|
||||
|
||||
//创建Boss
|
||||
GetSystem<DInputSystem>().SInput<IDWorld>().ForEach(child =>
|
||||
{
|
||||
|
||||
var idWorld = (IDWorld)child.Value;
|
||||
if (idWorld is { IsBossCreate: true })
|
||||
{
|
||||
var entity = NodeContext.CreateEntity();
|
||||
entity.Move.SetPosition(GetTileRandom());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b48944cb153b4e67809d2cddde1acc6b
|
||||
timeCreated: 1724724224
|
@@ -3,11 +3,8 @@ using Game.Input;
|
||||
using Game.JNGFrame.Logic.Entity;
|
||||
using Game.JNGFrame.Logic.Entity.Contexts;
|
||||
using JNGame.Math;
|
||||
using JNGame.Sync.Frame.Service;
|
||||
using JNGame.Sync.System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.Logic.System
|
||||
namespace Game.Logic.System.Logic
|
||||
{
|
||||
/// <summary>
|
||||
/// 玩家逻辑
|
||||
@@ -31,7 +28,7 @@ namespace Game.Logic.System
|
||||
var key = child.Key;
|
||||
var idWorld = (IDWorld)child.Value;
|
||||
|
||||
if (idWorld != null && idWorld.IsPlayerCreate)
|
||||
if (idWorld is { IsPlayerCreate: true })
|
||||
{
|
||||
var entity = NodeContext.CreateEntity();
|
||||
entity.Controller.AuthBind(key);
|
@@ -1,13 +1,10 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Game.Input;
|
||||
using Game.JNGFrame.Logic.Entity;
|
||||
using Game.JNGFrame.Logic.Entity.Contexts;
|
||||
using Game.Logic.System;
|
||||
using JNGame.Math;
|
||||
using JNGame.Sync.Frame.Service;
|
||||
using JNGame.Sync.System;
|
||||
|
||||
namespace Game.JNGFrame.Logic.System
|
||||
namespace Game.Logic.System.Logic
|
||||
{
|
||||
public class DWorldSystem : DGBasisSystem
|
||||
{
|
||||
@@ -15,7 +12,10 @@ namespace Game.JNGFrame.Logic.System
|
||||
//Node 节点
|
||||
public EDNode[] Nodes => NodeContext.GetHostEntities();
|
||||
public EDNodeContext NodeContext => Contexts.GetContext<EDNodeContext>();
|
||||
|
||||
|
||||
//Node 第一个节点
|
||||
public Queue<EDNode> NodeQueue = new();
|
||||
|
||||
public override void OnSyncUpdate()
|
||||
{
|
||||
|
||||
@@ -25,28 +25,29 @@ namespace Game.JNGFrame.Logic.System
|
||||
//超过500 则 销毁第一个实体
|
||||
if (Nodes.Length >= 100)
|
||||
{
|
||||
var node = Nodes[0];
|
||||
node.Destroy();
|
||||
NodeQueue.Dequeue().Destroy();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var max = 100;
|
||||
EDNode entity;
|
||||
if (IsTile())
|
||||
{
|
||||
var entity = Contexts.GetContext<EDNodeContext>().CreateEntity();
|
||||
entity = Contexts.GetContext<EDNodeContext>().CreateEntity();
|
||||
entity.Move.SetPosition(GetTileRandom());
|
||||
entity.Move.Go(GetTileRandom());
|
||||
}
|
||||
else
|
||||
{
|
||||
var entity = Contexts.GetContext<EDNodeContext>().CreateEntity();
|
||||
entity = Contexts.GetContext<EDNodeContext>().CreateEntity();
|
||||
var spawn = new LVector3(Random.Float(0, max),Random.Float(0, 100),Random.Float(0, max));
|
||||
entity.Move.SetPosition(spawn);
|
||||
spawn = new LVector3(Random.Float(0, max),Random.Float(0, 100),Random.Float(0, max));
|
||||
entity.Move.Go(spawn);
|
||||
}
|
||||
|
||||
|
||||
NodeQueue.Enqueue(entity);
|
||||
|
||||
}
|
||||
|
3
JNFrame2/Assets/Scripts/Game/Logic/System/Usual.meta
Normal file
3
JNFrame2/Assets/Scripts/Game/Logic/System/Usual.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c7f6594b809471b929e958068a70d32
|
||||
timeCreated: 1724724127
|
@@ -1,11 +1,8 @@
|
||||
using AppGame;
|
||||
using Game.Logic.System;
|
||||
using JNGame.Map;
|
||||
using JNGame.Map.DotRecast.Util;
|
||||
using JNGame.Sync.System;
|
||||
using Service;
|
||||
|
||||
namespace Game.JNGFrame.Logic
|
||||
namespace Game.Logic.System.Usual
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏数据
|
@@ -2,13 +2,11 @@
|
||||
using DotRecast.Core.Numerics;
|
||||
using DotRecast.Detour;
|
||||
using DotRecast.Detour.Crowd;
|
||||
using Game.Logic.System;
|
||||
using JNGame.Map.DotRecast;
|
||||
using JNGame.Math;
|
||||
using JNGame.Sync.System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Game.JNGFrame.Logic.System
|
||||
namespace Game.Logic.System.Usual
|
||||
{
|
||||
/// <summary>
|
||||
/// 地图
|
Reference in New Issue
Block a user