mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -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 环境
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using JNGame.Runtime.Util;
|
||||
using Samples.AppGame;
|
||||
|
||||
namespace AppGame
|
||||
{
|
||||
|
@@ -1,6 +1,4 @@
|
||||
using JNGame.Network.Action;
|
||||
|
||||
namespace AppGame
|
||||
namespace Samples.AppGame
|
||||
{
|
||||
public enum GActionEnum : int
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
namespace AppGame
|
||||
namespace Samples.AppGame
|
||||
{
|
||||
public class GEvent
|
||||
{
|
||||
|
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -6,6 +6,7 @@ using DotRecast.Core.Collections;
|
||||
using JNGame.Network;
|
||||
using JNGame.Network;
|
||||
using JNGame.Network.Action;
|
||||
using Samples.AppGame;
|
||||
|
||||
namespace AppGame.Systems
|
||||
{
|
||||
|
@@ -1,5 +1,6 @@
|
||||
using System.Threading.Tasks;
|
||||
using JNGame.Network.Group;
|
||||
using Samples.AppGame;
|
||||
|
||||
namespace AppGame.Systems
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user