CombatHeroInfo.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using Core.Utility;
  4. using Excel2Json;
  5. using Fort23.UTool;
  6. using UnityEngine;
  7. using UnityEngine.Serialization;
  8. [System.Serializable]
  9. public class CombatHeroInfo
  10. {
  11. public EncryptionLong hp=new EncryptionLong();
  12. public EncryptionLong defense=new EncryptionLong();
  13. public EncryptionLong attack=new EncryptionLong();
  14. public EncryptionFloat attSpeed=new EncryptionFloat();
  15. public EncryptionFloat crit=new EncryptionFloat();
  16. public EncryptionFloat critDamage=new EncryptionFloat();
  17. public EncryptionFloat dodge=new EncryptionFloat();
  18. public int lv;
  19. public int star;
  20. public HeroModelConfig modelConfig;
  21. /// <summary>
  22. /// 1=英雄 2=小怪 3=精英怪 4=boss
  23. /// </summary>
  24. public int heroType;
  25. public string modelName;
  26. public float maxDis=2;
  27. public float maxDisTo=2*2;
  28. public int[] skillId;
  29. public bool isGpu;
  30. public void InitMonster(int id,int level)
  31. {
  32. HeroModelConfig heroModelConfig = ConfigComponent.Instance.Get<HeroModelConfig>(id);
  33. HeroPowerUpConfig heroPowerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
  34. hp=(EncryptionLong)(heroModelConfig.hp*heroPowerUpConfig.HPFactor);
  35. defense=(EncryptionLong)(heroModelConfig.def*heroPowerUpConfig.DEFFactor);
  36. attack=(EncryptionLong)(heroModelConfig.attack*heroPowerUpConfig.ATKFactor);
  37. attSpeed=(EncryptionFloat)heroModelConfig.speed_atk;
  38. crit=(EncryptionFloat)heroModelConfig.crit;
  39. skillId = heroModelConfig.skillID;
  40. modelName = heroModelConfig.model;
  41. isGpu = heroModelConfig.isUseGpu;
  42. maxDis=heroModelConfig.range_atk;
  43. maxDisTo = maxDis * maxDis;
  44. }
  45. public CombatHeroInfo Copy()
  46. {
  47. CombatHeroInfo combatHeroInfo = (CombatHeroInfo)MemberwiseClone();
  48. return combatHeroInfo;
  49. }
  50. }