(client) feat:实现热重载
This commit is contained in:
@ -1,7 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Base;
|
||||
using Data;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace UI
|
||||
@ -22,12 +24,19 @@ namespace UI
|
||||
|
||||
private void Init()
|
||||
{
|
||||
InitReloadGameButton();
|
||||
InitEvent();
|
||||
InitCharacter();
|
||||
InitMonster();
|
||||
InitBuilding();
|
||||
}
|
||||
|
||||
private void InitReloadGameButton()
|
||||
{
|
||||
var button = InstantiatePrefab(buttonTemplate, menuContent.transform);
|
||||
button.Label = "热重载Def";
|
||||
button.AddListener(HotReload);
|
||||
}
|
||||
|
||||
private void InitEvent()
|
||||
{
|
||||
@ -162,6 +171,13 @@ namespace UI
|
||||
entityPlacementUI.snapEnabled = true;
|
||||
Base.UIInputControl.Instance.Show(entityPlacementUI);
|
||||
}
|
||||
|
||||
private void HotReload()
|
||||
{
|
||||
UIInputControl.Instance.HideAll();
|
||||
Program.Instance.needLoad = true;
|
||||
SceneManager.LoadScene(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user