mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
|
using System.Threading.Tasks;
|
|||
|
using Cinemachine;
|
|||
|
using Cysharp.Threading.Tasks;
|
|||
|
using JNGame.EntitasExtend;
|
|||
|
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 Player1;
|
|||
|
//世界
|
|||
|
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,CinemachineFreeLook freeLook)
|
|||
|
{
|
|||
|
Player1 = player;
|
|||
|
VWorld = world;
|
|||
|
FreeLook = freeLook;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|