40 lines
786 B
C#
40 lines
786 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SkillSlot : MonoBehaviour
|
|
{
|
|
public int skillId;
|
|
|
|
public int treeId;
|
|
|
|
private SkillManager skillmanager;
|
|
|
|
private Image background;
|
|
|
|
public Color backgroundBuyColor;
|
|
|
|
private void Start()
|
|
{
|
|
skillmanager = Object.FindObjectOfType<SkillManager>();
|
|
background = base.gameObject.GetComponent<Image>();
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
background.color = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(GameManager.Instance.gameSkills[treeId].skill[skillId].skillenum))
|
|
{
|
|
background.color = backgroundBuyColor;
|
|
}
|
|
}
|
|
|
|
public void SelectButton()
|
|
{
|
|
skillmanager.SelectSkill(skillId, treeId);
|
|
}
|
|
}
|