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
{