31 lines
787 B
C#
31 lines
787 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class BaseDetailMenu : MonoBehaviour
|
|
{
|
|
public Button Button_Back;
|
|
public Button Button_Close;
|
|
|
|
public Action onClickBack;
|
|
public Action onClickClose;
|
|
|
|
public virtual void Initialized()
|
|
{
|
|
var buttonDictionary = transform.FindComponentDictionary<Button>();
|
|
|
|
Button_Back = buttonDictionary.GetOrNull(nameof(Button_Back));
|
|
Button_Close = buttonDictionary.GetOrNull(nameof(Button_Close));
|
|
|
|
Button_Back.onClick.AddListener(OnClickBackButton);
|
|
Button_Close.onClick.AddListener(OnClickCloseButton);
|
|
}
|
|
private void OnClickBackButton()
|
|
{
|
|
onClickBack?.Invoke();
|
|
}
|
|
private void OnClickCloseButton()
|
|
{
|
|
onClickClose?.Invoke();
|
|
}
|
|
} |