SummonScoreRuleWidget.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Linq;
  2. using Core.Language;
  3. using Excel2Json;
  4. namespace Fort23.Mono
  5. {
  6. [UIBinding(prefab = "SummonScoreRuleWidget")]
  7. public partial class SummonScoreRuleWidget : UIComponent
  8. {
  9. AccountFileInfo.SummonSocreData socreData;
  10. private void Init()
  11. {
  12. }
  13. public override void AddEvent()
  14. {
  15. }
  16. public override void DelEvent()
  17. {
  18. }
  19. public override void AddButtonEvent()
  20. {
  21. }
  22. public void CustomInit(OpenBoxScoreRule scoreRule,int idnex)
  23. {
  24. if (idnex % 2 == 0)
  25. {
  26. ctc.ChangeState(0);
  27. }
  28. else
  29. {
  30. ctc.ChangeState(1);
  31. }
  32. AccountFileInfo.SummonData summonData = PlayerManager.Instance.SummonManager.summonDataMap[scoreRule.openBoxID];
  33. socreData = summonData.summonSocreData.FirstOrDefault(ss => ss.id == scoreRule.ID);
  34. Text_Name.text = LanguageManager.Instance.Text(scoreRule.lanID);
  35. Text_Score.text = scoreRule.score.ToString();
  36. Text_CompleteCount.text = socreData == null ? "0" : socreData.count.ToString();
  37. Text_AllScore.text = socreData == null ? "0" : (socreData.count * scoreRule.score).ToString();
  38. }
  39. }
  40. }