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
|
||||
{
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -1,6 +1,7 @@
|
||||
using AppGame;
|
||||
using JNGame.Map;
|
||||
using JNGame.Map.DotRecast.Util;
|
||||
using Samples.AppGame;
|
||||
|
||||
namespace Game.Logic.System.Usual
|
||||
{
|
||||
|
@@ -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
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -7,9 +7,7 @@
|
||||
"GUID:4307f53044263cf4b835bd812fc161a4",
|
||||
"GUID:a035c483e4ff50f4c92f84afd22778cf"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
|
@@ -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("加载地图资源完成");
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user