CombatHeroGameObject.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using Fort23.UTool;
  4. using GameLogic.Combat.Hero;
  5. using GameTimeLine.CustomizeTimeLogic;
  6. using UnityEngine;
  7. using Utility;
  8. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  9. public class CombatHeroGameObject
  10. {
  11. public GameObjectPool GameObjectPool;
  12. public CombatHeroAnimtion combatHeroAnimtion;
  13. public Vector3 position;
  14. private CombatHeroEntity _combatHeroEntity;
  15. private CombatHeroHitPoint _combatHeroHitPoints = new CombatHeroHitPoint();
  16. public void Init(CombatHeroEntity combatHeroEntity, GameObjectPool gameObjectPool)
  17. {
  18. _combatHeroEntity = combatHeroEntity;
  19. GameObjectPool = gameObjectPool;
  20. }
  21. public void SetGameObject(GameObjectPool gameObjectPool)
  22. {
  23. GameObjectPool = gameObjectPool;
  24. HitPointMono hitPointMonos = GameObjectPool.own.GetComponentInChildren<HitPointMono>(true);
  25. HitPointMono hitPointMono = hitPointMonos;
  26. _combatHeroHitPoints = new CombatHeroHitPoint();
  27. _combatHeroHitPoints.Init(_combatHeroEntity, hitPointMono);
  28. SpecialDotMono[] specialDotMonos = GameObjectPool.own.GetComponentsInChildren<SpecialDotMono>(true);
  29. for (int i = 0; i < specialDotMonos.Length; i++)
  30. {
  31. SpecialDotMono specialDotMono = specialDotMonos[i];
  32. SpecialDotInfo specialDotInfo = new SpecialDotInfo();
  33. specialDotInfo.dotName = specialDotMono.name;
  34. specialDotInfo.targetTran = specialDotMono.transform;
  35. specialDotInfo.heroEntity = _combatHeroEntity;
  36. // allSpecialDotInfo.Add(specialDotInfo);
  37. }
  38. }
  39. public T GetILifetCycleHitPoint<T>(string hitPoinName, bool isStandType, bool isIgnoreHind)
  40. where T : ILifetCycleHitPoint
  41. {
  42. return (T)(object)_combatHeroHitPoints;
  43. }
  44. public T GetMainHotPoin<T>(bool isIgnoreHind) where T : ILifetCycleHitPoint
  45. {
  46. return (T)(object)_combatHeroHitPoints;
  47. }
  48. }