63 lines
2.0 KiB
C#
63 lines
2.0 KiB
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
public class AssignSkill : MonoBehaviour
|
|
{
|
|
[SerializeField] private Button learnedSkillButton;
|
|
[SerializeField] private Button actionButton;
|
|
[SerializeField] private Button itemSkillButton;
|
|
[SerializeField] private Button buttonClose;
|
|
[SerializeField] private GameObject learnSkillUIPanel;
|
|
[SerializeField] private GameObject actionUIPanel;
|
|
[SerializeField] private GameObject itemUIPanel;
|
|
|
|
private void Awake()
|
|
{
|
|
learnedSkillButton.onClick.RemoveAllListeners();
|
|
actionButton.onClick.RemoveAllListeners();
|
|
itemSkillButton.onClick.RemoveAllListeners();
|
|
learnedSkillButton.onClick.AddListener(OnLearnedSkillButtonClicked);
|
|
actionButton.onClick.AddListener(OnActionButtonClicked);
|
|
itemSkillButton.onClick.AddListener(OnItemButtonClicked);
|
|
buttonClose.onClick.AddListener(OnCloseButtonClicked);
|
|
actionButton.interactable = false;
|
|
itemSkillButton.interactable = false;
|
|
}
|
|
void OnEnable()
|
|
{
|
|
learnSkillUIPanel.SetActive(true);
|
|
actionUIPanel.SetActive(false);
|
|
itemUIPanel.SetActive(false);
|
|
}
|
|
|
|
private void OnLearnedSkillButtonClicked()
|
|
{
|
|
learnSkillUIPanel.SetActive(true);
|
|
actionUIPanel.SetActive(false);
|
|
itemUIPanel.SetActive(false);
|
|
}
|
|
|
|
private void OnActionButtonClicked()
|
|
{
|
|
learnSkillUIPanel.SetActive(false);
|
|
actionUIPanel.SetActive(true);
|
|
learnSkillUIPanel.SetActive(false);
|
|
}
|
|
|
|
private void OnItemButtonClicked()
|
|
{
|
|
itemUIPanel.SetActive(true);
|
|
actionUIPanel.SetActive(false);
|
|
learnSkillUIPanel.SetActive(false);
|
|
}
|
|
|
|
private void OnCloseButtonClicked()
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|