mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
56 lines
1.3 KiB
C#
56 lines
1.3 KiB
C#
using AppGame;
|
|
using AppGame.Sync;
|
|
using Cinemachine;
|
|
using Game.Input;
|
|
using JNGame;
|
|
using JNGame.Sync.Debuger;
|
|
using UnityEngine;
|
|
|
|
public class DApplication : MonoBehaviour
|
|
{
|
|
|
|
public GameObject Player;
|
|
public GameObject Boss;
|
|
public GameObject VWorld;
|
|
public CinemachineFreeLook FreeLook;
|
|
|
|
private async void Awake()
|
|
{
|
|
|
|
await JNetGame.Instance.Init(App.AllSystem());
|
|
|
|
//绑定资源
|
|
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;
|
|
}
|
|
|
|
|
|
}
|