HeroEntityCombatReport.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. using System;
  2. using System.Collections.Generic;
  3. using Core.BattleReport;
  4. using GameLogic.Combat.CombatTool.CombatReport;
  5. using UnityEngine;
  6. using UnityEngine.UIElements;
  7. using static System.Drawing.FontStyle;
  8. namespace xy002Editor.CombatEditor
  9. {
  10. public class HeroEntityCombatReport : IDisposable
  11. {
  12. // public CombaReportEnditorManager manager;
  13. private CombatReportEntityInfo combatReportEntityInfo;
  14. private Foldout foldout;
  15. private CombaReportEnditorManager combaReportEnditorManager;
  16. public Foldout root;
  17. private ProgressBarShowModle cjShuXing;
  18. private ProgressBarShowModle shangHangXingXi;
  19. private ProgressBarShowModle zhiLiaoModle;
  20. private ProgressBarShowModle shouDaoShangHangXingXi;
  21. private CombatPeportMassgeModle combatPeportMassgeModle;
  22. public Foldout miaoShuFoldout;
  23. public void Init(CombatReportEntityInfo combatReportEntityInfo,
  24. CombaReportEnditorManager combaReportEnditorManager)
  25. {
  26. this.combaReportEnditorManager = combaReportEnditorManager;
  27. this.combatReportEntityInfo = combatReportEntityInfo;
  28. InitUI();
  29. }
  30. private void InitUI()
  31. {
  32. this.foldout = new Foldout();
  33. foldout.text =
  34. $"ID:{combatReportEntityInfo.CombatHeroEntity.CurrCombatHeroInfo.modelID}";
  35. // foldout.style.display = combatNewEditorWindow.heroData.style.display;
  36. // foldout.style.marginLeft;
  37. foldout.style.fontSize = 12;
  38. // foldout.style.unityFontStyleAndWeight = Bold;
  39. foldout.value = false;
  40. if (combatReportEntityInfo.CombatHeroEntity.IsEnemy)
  41. {
  42. root = combaReportEnditorManager.enemyHeroRoot;
  43. }
  44. else
  45. {
  46. root = combaReportEnditorManager.myHeroRoot;
  47. }
  48. root.Add(foldout);
  49. VisualElement visualElement_h = new VisualElement();
  50. // VisualElement visualElement_h =combaReportEnditorManager.Copy<VisualElement>("hengxiang");
  51. foldout.Add(visualElement_h);
  52. VisualElement visualElement_v = combaReportEnditorManager.Copy<VisualElement>("value_data_entity_style"); //英雄信息
  53. visualElement_h.Add(visualElement_v);
  54. Label label = new Label();
  55. label.text = "玩家名" + combatReportEntityInfo.CombatHeroEntity.CurrCombatHeroInfo.heroName;
  56. visualElement_v.Add(label);
  57. label = new Label();
  58. label.text = "等级" + combatReportEntityInfo.CombatHeroEntity.CurrCombatHeroInfo.level;
  59. visualElement_v.Add(label);
  60. ScrollView ScrollView = combaReportEnditorManager.Copy<ScrollView>("value_scrollview");
  61. foldout.Add(ScrollView);
  62. Foldout foldout1 = combaReportEnditorManager.Copy<Foldout>("foldout_style2");
  63. foldout1.text = "英雄属性";
  64. foldout1.style.unityFontStyleAndWeight = FontStyle.Bold;
  65. foldout1.value = false;
  66. visualElement_h.Add(foldout1);
  67. VisualElement progressVe = combaReportEnditorManager.Copy<VisualElement>("value_data_style2");
  68. foldout1.Add(progressVe);
  69. cjShuXing = new ProgressBarShowModle(progressVe, combaReportEnditorManager);
  70. foldout1 = combaReportEnditorManager.Copy<Foldout>("foldout_style");
  71. foldout1.text = "照成伤害信息";
  72. foldout1.style.unityFontStyleAndWeight = FontStyle.Bold;
  73. foldout1.value = false;
  74. visualElement_h.Add(foldout1);
  75. progressVe = combaReportEnditorManager.Copy<VisualElement>("value_data_style");
  76. foldout1.Add(progressVe);
  77. shangHangXingXi = new ProgressBarShowModle(progressVe, combaReportEnditorManager);
  78. foldout1 = combaReportEnditorManager.Copy<Foldout>("foldout_style");
  79. foldout1.text = "治疗和被治疗信息";
  80. foldout1.style.unityFontStyleAndWeight = FontStyle.Bold;
  81. foldout1.value = false;
  82. visualElement_h.Add(foldout1);
  83. progressVe = combaReportEnditorManager.Copy<VisualElement>("value_data_style");
  84. foldout1.Add(progressVe);
  85. zhiLiaoModle = new ProgressBarShowModle(progressVe, combaReportEnditorManager);
  86. foldout1 = combaReportEnditorManager.Copy<Foldout>("foldout_style");
  87. foldout1.text = "受到伤害信息";
  88. foldout1.style.unityFontStyleAndWeight = FontStyle.Bold;
  89. foldout1.value = false;
  90. visualElement_h.Add(foldout1);
  91. progressVe = combaReportEnditorManager.Copy<VisualElement>("value_data_style");
  92. foldout1.Add(progressVe);
  93. shouDaoShangHangXingXi = new ProgressBarShowModle(progressVe, combaReportEnditorManager);
  94. miaoShuFoldout = combaReportEnditorManager.Copy<Foldout>("foldout_style");
  95. miaoShuFoldout.text = "战斗描述";
  96. miaoShuFoldout.style.unityFontStyleAndWeight = FontStyle.Bold;
  97. miaoShuFoldout.value = false;
  98. visualElement_h.Add(miaoShuFoldout);
  99. VisualElement miaoshuve = combaReportEnditorManager.Copy<VisualElement>("miaoshuve"); //英雄信息
  100. miaoShuFoldout.Add(miaoshuve);
  101. combatPeportMassgeModle=new CombatPeportMassgeModle();
  102. combatPeportMassgeModle.Init(miaoshuve, combatReportEntityInfo, combaReportEnditorManager);
  103. }
  104. public void OnGUI()
  105. {
  106. if (!foldout.value)
  107. {
  108. return;
  109. }
  110. DrwaBattleReportValueDataModule(combatReportEntityInfo.HeroInfoModule, cjShuXing);
  111. DrwaBattleReportValueDataModule(combatReportEntityInfo.zhiLiao, zhiLiaoModle);
  112. DrwaBattleReportValueDataModule(combatReportEntityInfo.CombatInfoModule, shangHangXingXi);
  113. DrwaBattleReportValueDataModule(combatReportEntityInfo.InjuredInfoModule, shouDaoShangHangXingXi);
  114. if (miaoShuFoldout.value)
  115. {
  116. combatPeportMassgeModle.OnGui();
  117. }
  118. }
  119. private void DrwaBattleReportValueDataModule(BattleReportValueDataModule battleReportValueDataModule,
  120. ProgressBarShowModle progressBarShowModle)
  121. {
  122. foreach (var VARIABLE in battleReportValueDataModule.fightValueData_long.Values)
  123. {
  124. ReportFightValueData<long> reportFightValueData = VARIABLE;
  125. progressBarShowModle.CrendHarmValue(reportFightValueData.name, reportFightValueData.value,
  126. reportFightValueData.maxValue);
  127. }
  128. }
  129. public void Dispose()
  130. {
  131. combatReportEntityInfo = null;
  132. }
  133. }
  134. }