This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-11-24 19:33:12 +08:00
parent a0a8751aa5
commit e77dd9e841
47 changed files with 28545 additions and 17360 deletions

View File

@@ -1,11 +1,12 @@
using AppGame.Systems;
using AppGame;
using AppGame.Systems;
using AppGame.Systems.CServer;
using JNGame.Runtime.System;
using JNGame.Runtime.Util;
using JNGame.Util;
using Service;
namespace AppGame
namespace Samples.AppGame
{
/// <summary>
/// App 环境

View File

@@ -3,54 +3,56 @@ using AppGame.Sync;
using Cinemachine;
using Game.Input;
using JNGame.Runtime;
using JNGame;
using JNGame.Sync.Debuger;
using UnityEngine;
public class DApplication : MonoBehaviour
namespace Samples.AppGame
{
public GameObject Player;
public GameObject Boss;
public GameObject VWorld;
public CinemachineFreeLook FreeLook;
private async void Awake()
public class DApplication : MonoBehaviour
{
await JNetGame.Instance.Init(App.AllSystem());
//绑定资源
App.Resource.Register(VWorld,Player,Boss,FreeLook);
//开始运行同步
if (App.IsServer())
public GameObject Player;
public GameObject Boss;
public GameObject VWorld;
public CinemachineFreeLook FreeLook;
private async void Awake()
{
var tileServer = App.Game.StartServer<JNGTileServerSystem>();
JNTileServerDebuger.Instance.Add(tileServer);
}
if (App.IsSlaveServer()) App.Game.StartServer<JNGTileSlaveServerSystem>();
if (App.IsClient()) App.Game.StartClient<JNGTileClientSystem>();
}
await JNetGame.Instance.Init(App.AllSystem());
public void OnClickPlayerCreate()
{
var input = App.Game.GetInput<IDWorld>();
input.IsPlayerCreate = true;
//绑定资源
App.Resource.Register(VWorld,Player,Boss,FreeLook);
//开始运行同步
if (App.IsServer())
{
var tileServer = App.Game.StartServer<JNGTileServerSystem>();
JNTileServerDebuger.Instance.Add(tileServer);
}
if (App.IsSlaveServer()) App.Game.StartServer<JNGTileSlaveServerSystem>();
if (App.IsClient()) App.Game.StartClient<JNGTileClientSystem>();
}
public void OnClickPlayerCreate()
{
var input = App.Game.GetInput<IDWorld>();
input.IsPlayerCreate = true;
}
public void OnClickBossCreate()
{
var input = App.Game.GetInput<IDWorld>();
input.IsBossCreate = true;
}
public void OnClickButton()
{
var input = App.Game.GetInput<IDWorld>();
input.IsAdd = true;
}
}
public void OnClickBossCreate()
{
var input = App.Game.GetInput<IDWorld>();
input.IsBossCreate = true;
}
public void OnClickButton()
{
var input = App.Game.GetInput<IDWorld>();
input.IsAdd = true;
}
}

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Cysharp.Threading.Tasks;
using JNGame.Runtime.Util;
using Samples.AppGame;
namespace AppGame
{

View File

@@ -1,6 +1,4 @@
using JNGame.Network.Action;
namespace AppGame
namespace Samples.AppGame
{
public enum GActionEnum : int
{

View File

@@ -1,4 +1,4 @@
namespace AppGame
namespace Samples.AppGame
{
public class GEvent
{

View File

@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.SceneManagement;
namespace AppGame
namespace Samples.AppGame
{
public class Main : MonoBehaviour
{
@@ -9,30 +9,30 @@ namespace AppGame
public void SetClientEnv()
{
App.Env = AppEnv.Client;
SceneManager.LoadScene(1);
SceneManager.LoadScene("JNFrame");
}
public void SetServerEnv()
{
App.Env = AppEnv.Server;
SceneManager.LoadScene(1);
SceneManager.LoadScene("JNFrame");
}
public void SetServerClientEnv()
{
App.Env = AppEnv.ServerClient;
SceneManager.LoadScene(1);
SceneManager.LoadScene("JNFrame");
}
public void SetSlaveServerEnv()
{
App.Env = AppEnv.SlaveServer;
SceneManager.LoadScene(1);
SceneManager.LoadScene("JNFrame");
}
public void SetSlaveServerClientEnv()
{
App.Env = AppEnv.SlaveServerClient;
SceneManager.LoadScene(1);
SceneManager.LoadScene("JNFrame");
}
}

View File

@@ -13,6 +13,7 @@ using JNGame.Sync.Frame;
using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Network.Action;
using Samples.AppGame;
using UnityEngine;
namespace AppGame.Sync

View File

@@ -12,6 +12,7 @@ using JNGame.Sync.State;
using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Network.Action;
using Samples.AppGame;
namespace AppGame.Sync
{

View File

@@ -14,6 +14,7 @@ using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Util;
using JNGame.Network.Action;
using Samples.AppGame;
using UnityEngine;
namespace AppGame.Sync

View File

@@ -18,6 +18,7 @@ using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Util;
using JNGame.Network.Action;
using Samples.AppGame;
using UnityEngine;
namespace AppGame.Sync

View File

@@ -19,6 +19,7 @@ using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Util;
using JNGame.Network.Action;
using Samples.AppGame;
using UnityEngine;
namespace AppGame.Sync

View File

@@ -6,6 +6,7 @@ using DotRecast.Core.Collections;
using JNGame.Network;
using JNGame.Network;
using JNGame.Network.Action;
using Samples.AppGame;
namespace AppGame.Systems
{

View File

@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using JNGame.Network.Group;
using Samples.AppGame;
namespace AppGame.Systems
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using JNGame.Network;
using JNGame.Network;
using Samples.AppGame;
namespace AppGame.Systems.CServer
{

View File

@@ -11,6 +11,7 @@ using JNGame.Sync.State.Tile;
using JNGame.Sync.System.Data;
using JNGame.Network;
using JNGame.Network.Action;
using Samples.AppGame;
namespace AppGame.Systems.CServer
{

View File

@@ -4,6 +4,7 @@ using Cysharp.Threading.Tasks;
using DotRecast.Core.Collections;
using JNGame.Network;
using JNGame.Network.Action;
using Samples.AppGame;
namespace AppGame.Systems
{

View File

@@ -5,6 +5,7 @@ using AppGame.Sync;
using Cysharp.Threading.Tasks;
using JNGame.Network;
using JNGame.Network.Action;
using Samples.AppGame;
public class JNGSocket : JNSocket
{

View File

@@ -10,6 +10,7 @@ using JNGame.Sync.System;
using JNGame.Sync.System.Data;
using JNGame.Network.Action;
using JNGame.Sync.System.Data.Type;
using Samples.AppGame;
using TouchSocket.Core;
using UnityEngine.Serialization;

View File

@@ -1,6 +1,7 @@
using AppGame;
using JNGame.Map;
using JNGame.Map.DotRecast.Util;
using Samples.AppGame;
namespace Game.Logic.System.Usual
{

View File

@@ -3,6 +3,7 @@ using AppGame;
using DG.Tweening;
using Game.JNGState.Logic.Data;
using JNGame.Sync.System;
using Samples.AppGame;
using UnityEngine;
namespace Game.JNGFrame.View.Entity

View File

@@ -6,6 +6,7 @@ using Game.JNGState.Logic.Data;
using JNGame.Math;
using JNGame.Sync.System;
using JNGame.Sync.View;
using Samples.AppGame;
using Service;
using UnityEngine;

View File

@@ -7,6 +7,7 @@ using DG.Tweening;
using Game.JNGState.Logic.Data;
using JNGame.Sync.System;
using JNGame.Sync.View;
using Samples.AppGame;
using UnityEngine;
namespace Game.JNGFrame.View.Entity

View File

@@ -7,9 +7,7 @@
"GUID:4307f53044263cf4b835bd812fc161a4",
"GUID:a035c483e4ff50f4c92f84afd22778cf"
],
"includePlatforms": [
"Editor"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,

View File

@@ -31,8 +31,8 @@ namespace Service
public override async Task OnInit()
{
var map = await Resources.LoadAsync<TextAsset>("Battle/Map/NavMesh/Map_1001.navmesh") as TextAsset;
var map2 = await Resources.LoadAsync<TextAsset>("map1") as TextAsset;
var map = await Resources.LoadAsync<TextAsset>("Samples/Battle/Map/NavMesh/Map_1001.navmesh") as TextAsset;
var map2 = await Resources.LoadAsync<TextAsset>("Samples/map1") as TextAsset;
if (map != null) MapData = JsonUtil.ToObject<StaticMapData>(map.text);
if (map2 != null) MapData2 = JsonUtil.ToObject<MeshData>(map2.text);
if (MapData != null) Debug.Log("加载地图资源完成");

View File

@@ -6,6 +6,7 @@ using Game.Input;
using JNGame.Runtime.Util;
using JNGame.Math;
using JNGame.Util;
using Samples.AppGame;
using UnityEngine;
using UnityEngine.UI;