备份CatanBuilding瘦身独立工程
This commit is contained in:
47
Assets/Scripts/HexGrid/HexMapPanel.cs
Normal file
47
Assets/Scripts/HexGrid/HexMapPanel.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using asap.core;
|
||||
using game;
|
||||
using GameCore;
|
||||
using PlayFab.Internal;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace HexGrid
|
||||
{
|
||||
public class HexMapPanel : MonoBehaviour
|
||||
{
|
||||
private Button btn_close;
|
||||
private Button btnClear;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
btn_close = transform.Find("root/btn_close").GetComponent<Button>();
|
||||
btn_close.onClick.AddListener(OnClose);
|
||||
|
||||
btnClear = transform.Find("root/btn_clear").GetComponent<Button>();
|
||||
btnClear.onClick.AddListener(OnClear);
|
||||
|
||||
}
|
||||
|
||||
private void OnClear()
|
||||
{
|
||||
Log("OnClear-> ");
|
||||
var hmdm = GContext.container.Resolve<HexMapDataManager>();
|
||||
hmdm.ClearMapData();
|
||||
hmdm.Init();
|
||||
|
||||
OnClose();
|
||||
}
|
||||
private void OnClose()
|
||||
{
|
||||
GContext.Publish(new UnloadActToNextAct());
|
||||
btn_close.onClick.RemoveAllListeners();
|
||||
}
|
||||
|
||||
private static void Log(object message)
|
||||
{
|
||||
Debug.Log($"<color=orange>HexMapPanel => {message} </color>");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user