FaBaoAttributeWidget.cs 925 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. namespace Fort23.Mono
  2. {
  3. [UIBinding(prefab = "FaBaoAttributeWidget")]
  4. public partial class FaBaoAttributeWidget : UIComponent
  5. {
  6. private void Init()
  7. {
  8. }
  9. public override void AddEvent()
  10. {
  11. }
  12. public override void DelEvent()
  13. {
  14. }
  15. public override void AddButtonEvent()
  16. {
  17. }
  18. public void CusomtInit(int type,long value)
  19. {
  20. Text_AttributeName.text = GetAttributeName(type);
  21. Text_AttributeValue.text = value.ToString();
  22. }
  23. private string GetAttributeName(int type)
  24. {
  25. switch (type)
  26. {
  27. case 1:
  28. return "生命";
  29. case 2:
  30. return "防御";
  31. case 3:
  32. return "攻击";
  33. }
  34. return "";
  35. }
  36. }
  37. }