47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
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>");
|
|
}
|
|
|
|
}
|
|
} |