CombatHeroHitPoint.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Collections.Generic;
  2. using GameTimeLine.CustomizeTimeLogic;
  3. using UnityEngine;
  4. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  5. namespace GameLogic.Combat.Hero
  6. {
  7. public class CombatHeroHitPoint : ILifetCycleHitPoint
  8. {
  9. public List<SpecialDotInfo> allSpecialDotInfo = new List<SpecialDotInfo>();
  10. public CombatHeroEntity combatHeroEntity;
  11. public ILifeCycle IfLifeCycle
  12. {
  13. get { return combatHeroEntity; }
  14. }
  15. public Vector3 Position
  16. {
  17. get { return _hitPointMono.transform.position; }
  18. }
  19. private HitPointMono _hitPointMono;
  20. public T This<T>()
  21. {
  22. return (T)(object)this;
  23. }
  24. public void Init(CombatHeroEntity combatHeroEntity, HitPointMono hitPointMono)
  25. {
  26. this.combatHeroEntity = combatHeroEntity;
  27. _hitPointMono = hitPointMono;
  28. SpecialDotMono[] specialDotMonos = combatHeroEntity.combatHeroGameObject.GameObjectPool.own
  29. .GetComponentsInChildren<SpecialDotMono>(true);
  30. for (int i = 0; i < specialDotMonos.Length; i++)
  31. {
  32. SpecialDotMono specialDotMono = specialDotMonos[i];
  33. SpecialDotInfo specialDotInfo = new SpecialDotInfo();
  34. specialDotInfo.dotName = specialDotMono.name;
  35. specialDotInfo.targetTran = specialDotMono.transform;
  36. specialDotInfo.heroEntity = combatHeroEntity;
  37. allSpecialDotInfo.Add(specialDotInfo);
  38. }
  39. }
  40. public SpecialDotInfo GetSpecialDotInfo(string specialDotName)
  41. {
  42. for (int i = 0; i < allSpecialDotInfo.Count; i++)
  43. {
  44. if (allSpecialDotInfo[i].dotName == specialDotName)
  45. {
  46. return allSpecialDotInfo[i];
  47. }
  48. }
  49. return null;
  50. }
  51. }
  52. }