12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using GameLogic.Hero;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "FaBaoAttributeWidget")]
- public partial class FaBaoAttributeWidget : UIComponent
- {
- public FaBaoInfo faBaoInfo;
- public int key;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- }
- public void CusomtInit(FaBaoInfo faBaoInfo, int key)
- {
- this.faBaoInfo = faBaoInfo;
- this.key = key;
- Text_AttributeName.text = GetAttributeName(key);
- Text_AttributeValue.text = faBaoInfo.attriButedIC[key].ToString();
- Text_NextAttributeValue.gameObject.SetActive(false);
- }
- public void StartUpGrad(FaBaoInfo nextFabaoInfo )
- {
-
- Text_NextAttributeValue.text = $"+{nextFabaoInfo.attriButedIC[key] - faBaoInfo.attriButedIC[key]}";
- Text_NextAttributeValue.gameObject.SetActive(true);
- }
- public void EndUpGrade()
- {
- Text_NextAttributeValue.gameObject.SetActive(false);
- }
- private string GetAttributeName(int type)
- {
- switch (type)
- {
- case 1:
- return "生命";
- case 2:
- return "防御";
- case 3:
- return "攻击";
- }
- return "";
- }
- }
- }
|