2024-12-09 23:24:46 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2024-12-10 06:57:53 +08:00
|
|
|
|
using UnityEngine.UI;
|
2024-12-09 23:24:46 +08:00
|
|
|
|
|
2024-12-10 06:57:53 +08:00
|
|
|
|
public class SkillBox : Base
|
2024-12-09 23:24:46 +08:00
|
|
|
|
{
|
2024-12-10 06:57:53 +08:00
|
|
|
|
|
|
|
|
|
public static SkillBox instance;
|
|
|
|
|
[Header("ս<><D5BD>(<28><><EFBFBD><EFBFBD>)")] public int expNumber;
|
|
|
|
|
[Header("ս<><D5BD>(<28><><EFBFBD><EFBFBD>)")] public Text expNumberText;
|
|
|
|
|
[Header("<22><><EFBFBD><EFBFBD>ս<EFBFBD><D5BD>(<28><><EFBFBD><EFBFBD>)")] public int maxExpNumber;
|
2024-12-13 05:40:51 +08:00
|
|
|
|
|
|
|
|
|
public GameObject infobox_skill;
|
|
|
|
|
|
|
|
|
|
public GameObject Skill;
|
|
|
|
|
|
|
|
|
|
public Transform SkillParent;
|
2024-12-10 06:57:53 +08:00
|
|
|
|
[HideInInspector]
|
|
|
|
|
public int ExpNumber
|
|
|
|
|
{
|
|
|
|
|
get => expNumber;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
expNumber = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
[Header("ս<><D5BD>(<28><><EFBFBD><EFBFBD>)<29><><EFBFBD><EFBFBD>")] public GameObject ExpFileObj;
|
|
|
|
|
private int ExpFileObjNumber=0;
|
|
|
|
|
[Header("ս<><D5BD>(<28><><EFBFBD><EFBFBD>)<29><><EFBFBD>丸<EFBFBD>ڵ<EFBFBD>")] public GameObject ExpFilePrante;
|
|
|
|
|
|
|
|
|
|
public List<GameObject> expList = new List<GameObject>();
|
|
|
|
|
private void Start()
|
2024-12-09 23:24:46 +08:00
|
|
|
|
{
|
2024-12-10 06:57:53 +08:00
|
|
|
|
if (instance != null) return;
|
|
|
|
|
instance = this;
|
2024-12-13 05:40:51 +08:00
|
|
|
|
|
|
|
|
|
InitSkil();
|
|
|
|
|
|
2024-12-09 23:24:46 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-12-10 06:57:53 +08:00
|
|
|
|
public void UpdataExp(int number)
|
2024-12-09 23:24:46 +08:00
|
|
|
|
{
|
2024-12-10 06:57:53 +08:00
|
|
|
|
|
|
|
|
|
if (number > 0)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < number; i++)
|
|
|
|
|
{
|
|
|
|
|
if (expList.Count < maxExpNumber)
|
|
|
|
|
{
|
|
|
|
|
GameObject obj = Instantiate(ExpFileObj, ExpFilePrante.transform);
|
|
|
|
|
expList.Add(obj);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(number < 0)
|
|
|
|
|
{
|
|
|
|
|
number *= -1;
|
|
|
|
|
for (int i = 0; i < number; i++)
|
|
|
|
|
{
|
|
|
|
|
GameObject obj = expList[expList.Count - 1];
|
|
|
|
|
expList.RemoveAt(expList.Count - 1);
|
|
|
|
|
Destroy(obj.gameObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expNumberText.text = expList.Count+"/"+maxExpNumber;
|
2024-12-09 23:24:46 +08:00
|
|
|
|
}
|
2024-12-10 06:57:53 +08:00
|
|
|
|
|
2024-12-13 05:40:51 +08:00
|
|
|
|
void InitSkil()
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < Base.GlobalObj.GetComponent<gameGlobal>().CarryCardId.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
GameObject obj = Instantiate(Skill,SkillParent);
|
|
|
|
|
obj.GetComponent<Skill_Spend>().infobox_skill_up = infobox_skill;
|
|
|
|
|
//obj.GetComponent<Skill_Spend>().SkillID
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-10 06:57:53 +08:00
|
|
|
|
|
2024-12-13 05:40:51 +08:00
|
|
|
|
}
|
2024-12-09 23:24:46 +08:00
|
|
|
|
}
|