This commit is contained in:
PC-20230316NUNE\Administrator
2024-09-29 20:30:29 +08:00
parent c5700ce655
commit a16d51d033
151 changed files with 69 additions and 63 deletions

View File

@@ -0,0 +1,50 @@
using System.Threading.Tasks;
using Cinemachine;
using Cysharp.Threading.Tasks;
using JNGame.Map;
using JNGame.Map.DotRecast.Util;
using JNGame.Util;
using Plugins.JNGame.Network;
using UnityEngine;
namespace Service
{
public class JNGResService : JNServerBase
{
//地图数据
public StaticMapData MapData;
//地图数据2
public MeshData MapData2;
//角色1
public GameObject Player;
//Boss
public GameObject Boss;
//世界
public GameObject VWorld;
//相机
public CinemachineFreeLook FreeLook;
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;
if (map != null) MapData = JsonUtil.ToObject<StaticMapData>(map.text);
if (map2 != null) MapData2 = JsonUtil.ToObject<MeshData>(map2.text);
if (MapData != null) Debug.Log("加载地图资源完成");
}
public void Register(GameObject world,GameObject player,GameObject boss,CinemachineFreeLook freeLook)
{
Player = player;
Boss = boss;
VWorld = world;
FreeLook = freeLook;
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: bbb29afc17db434db7a6fc5ce397b248
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: