CombatHeroEntity.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using Fort23.Core;
  4. using Fort23.UTool;
  5. using GameLogic.Combat.Hero;
  6. using UnityEngine;
  7. using UnityEngine.Rendering;
  8. using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  9. public class CombatHeroEntity : ITimeLineSpecialDotPos, ILifeCycle
  10. {
  11. public bool IsEnemy;
  12. public CombatAIBasic CombatAIBasic;
  13. public CombatHeroGameObject combatHeroGameObject;
  14. public CombatHeroInfo CurrCombatHeroInfo;
  15. public CombatHeroInfo MaxCombatHeroInfo;
  16. public CombatHeroTimeLineControl combatHeroTimeLineControl;
  17. public Vector3 dotPos
  18. {
  19. get { return combatHeroGameObject.position; }
  20. }
  21. public Vector3 faceDir { get; }
  22. public async CTask<CombatHeroEntity> Init(CombatAIBasic combatAIBasic, CombatHeroInfo combatHeroInfo)
  23. {
  24. //后面记到检查战斗里面不要出现异步加载,也不要出现同步IO加载
  25. IGObjectPoolInterface poolInterface =
  26. await GObjectPool.Instance.FetchAsync<GameObjectPool>(combatHeroInfo.modelName + ".prefab", null);
  27. #if !COMBAT_SERVER
  28. if (poolInterface == null || poolInterface.own == null)
  29. {
  30. return null;
  31. }
  32. #endif
  33. return this;
  34. }
  35. public void Update(float t)
  36. {
  37. }
  38. public T This<T>()
  39. {
  40. return (T)(object)this;
  41. }
  42. public T GetILifetCycleHitPoint<T>(string hitPoinName, bool isStandType, bool isIgnoreHind)
  43. where T : ILifetCycleHitPoint
  44. {
  45. return combatHeroGameObject.GetILifetCycleHitPoint<T>(hitPoinName, isStandType, isIgnoreHind);
  46. }
  47. public T GetMainHotPoin<T>(bool isIgnoreHind) where T : ILifetCycleHitPoint
  48. {
  49. return combatHeroGameObject.GetMainHotPoin<T>(isIgnoreHind);
  50. }
  51. }