FxAILogicBasic.cs 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. // using System;
  2. //
  3. // using CombatLibrary.CombatLibrary.CombatCore.CustomizeTimeLogic.FxLogic;
  4. //
  5. // using Fort23.Common;
  6. // using Fort23.Core;
  7. // using Fort23.UTool;
  8. //
  9. // #if !COMBAT_SERVER
  10. // using UnityEngine;
  11. // #endif
  12. //
  13. // using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
  14. // using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventLogic;
  15. //
  16. // namespace Common.Combat.FxAILogic
  17. // {
  18. // public class FxAILogicBasic : IDisposable, ITimelineFxLogic
  19. // {
  20. // protected TimeLineEventParticleLogicBasic timeLineEventParticleLogicBasic;
  21. // protected ILifetCycleHitPoint attTarget;
  22. //
  23. // public ILifetCycleHitPoint AttTarget
  24. // {
  25. // get { return attTarget; }
  26. // }
  27. //
  28. // public TimeLineEventParticleLogicBasic TimeLineEventParticleLogicBasic
  29. // {
  30. // get { return timeLineEventParticleLogicBasic; }
  31. // }
  32. // public IGObjectPoolInterface ObjectPoolInterface;
  33. //
  34. // public long InitGuid;
  35. // protected int _updateCount;
  36. //
  37. // protected float _initTime;
  38. //
  39. //
  40. // public bool isPenetrate;
  41. //
  42. //
  43. //
  44. // /// <summary>
  45. // /// 开始点
  46. // /// </summary>
  47. // protected Vector3 startPos;
  48. //
  49. // public Vector3 CurrPos
  50. // {
  51. // get { return _currPos; }
  52. // }
  53. //
  54. // /// <summary>
  55. // /// 当前Obj的位置
  56. // /// </summary>
  57. // protected Vector3 _currPos;
  58. //
  59. // protected Vector3 rotation;
  60. //
  61. // protected SpecialDotInfo specialDotInfo;
  62. // protected float currTime;
  63. //
  64. // public TriggerData triggerData;
  65. //
  66. // protected bool isNotCanTriggerGround;
  67. //
  68. // protected bool _isUpdateBasic;
  69. //
  70. // public void Init(Vector3 startPos,
  71. // TimeLineEventParticleLogicBasic timeLineEventParticleLogicBasic, ILifetCycleHitPoint attTarget,
  72. // SpecialDotInfo specialDotInfo = null)
  73. // {
  74. //
  75. // _currPos = startPos;
  76. // this.startPos = startPos;
  77. // this.timeLineEventParticleLogicBasic = timeLineEventParticleLogicBasic;
  78. //
  79. //
  80. // this.attTarget = attTarget;
  81. //
  82. // this.specialDotInfo = specialDotInfo;
  83. // ITimeLineTriggerEvent trigger = timeLineEventParticleLogicBasic.ITimeLineTriggerEntity as ITimeLineTriggerEvent;
  84. // if (trigger != null)
  85. // {
  86. // trigger.TimelineFxLogicInit(timeLineEventParticleLogicBasic.timeLinePlayFxSerializtion.groupName, this,
  87. // triggerData);
  88. // }
  89. //
  90. // _initTime = 0;
  91. // triggerData = timeLineEventParticleLogicBasic.extraData;
  92. // triggerData.TrggerObject = this;
  93. //
  94. // _isUpdateBasic = true;
  95. // ProInit();
  96. // }
  97. //
  98. // public void SetAIMonoObj(IGObjectPoolInterface poolInterface)
  99. // {
  100. // this.ObjectPoolInterface = poolInterface;
  101. // }
  102. //
  103. //
  104. // private void Detection()
  105. // {
  106. // if (_updateCount % 2 != 0)
  107. // {
  108. // return;
  109. // }
  110. //
  111. // ProDetection();
  112. // }
  113. //
  114. // protected virtual void ProDetection()
  115. // {
  116. // }
  117. //
  118. //
  119. //
  120. //
  121. //
  122. // protected void Hit(string fxName, Vector3 startPos, ILifetCycleHitPoint fxTarget, bool isRotate,
  123. // SpecialDotInfo targetSpecialDotInfo)
  124. // {
  125. // if (string.IsNullOrEmpty(fxName))
  126. // {
  127. // return;
  128. // }
  129. //
  130. // CombatFactoryTool.Instance.CreateParticle(fxName, startPos, fxTarget, isRotate,
  131. // targetSpecialDotInfo, delegate(CombatParticleSystemPool pool)
  132. // {
  133. // #if !COMBAT_SERVER
  134. // if (ObjectPoolInterface != null&&pool.own!=null)
  135. // {
  136. // FxColorAlter colorAlter = ObjectPoolInterface.own.GetComponent<FxColorAlter>();
  137. // if (colorAlter != null)
  138. // {
  139. // FxColorAlter colorAlter2 = pool.own.GetComponent<FxColorAlter>();
  140. // if (colorAlter2 == null)
  141. // {
  142. // colorAlter2 = pool.own.AddComponent<FxColorAlter>();
  143. // }
  144. //
  145. // colorAlter2.AlterColor(colorAlter.currValue);
  146. // }
  147. // }
  148. // #endif
  149. // });
  150. // }
  151. //
  152. // public void CombatUpdate(float time)
  153. // {
  154. // if (!_isUpdateBasic)
  155. // {
  156. // return;
  157. // }
  158. //
  159. // _updateCount++;
  160. // _initTime += time;
  161. // ProCombatUpdate(time);
  162. // if (timeLineEventParticleLogicBasic == null)
  163. // {
  164. // return;
  165. // }
  166. //
  167. // Detection();
  168. // if (ObjectPoolInterface != null && !UnityRenderUpdateComponent.Instance.isActive)
  169. // {
  170. // UnityRenderUpdate(time);
  171. // }
  172. // }
  173. //
  174. // public int initLogicFrame { get; set; }
  175. // public int initRenderFrame { get; set; }
  176. //
  177. // public void UnityRenderUpdate(float time)
  178. // {
  179. // ProUnityRenderUpdate(time);
  180. // }
  181. //
  182. // public void UnityRenderUpdateFinish()
  183. // {
  184. // }
  185. //
  186. // public void Dispose()
  187. // {
  188. // if (timeLineEventParticleLogicBasic == null)
  189. // {
  190. // return;
  191. // }
  192. //
  193. // string scName = _fxAiDataBasic.aiScriptName;
  194. // CombatHeroEntity combatHeroEntity = timeLineEventParticleLogicBasic.castEntity.This<CombatHeroEntity>();
  195. // if (combatHeroEntity != null)
  196. // {
  197. // combatHeroEntity.CombatReportHeroInfo.RemoveRepotLogs(this);
  198. // }
  199. //
  200. // GObjectPool.Instance.Recycle(ObjectPoolInterface);
  201. // CombatFactoryTool.Instance.RemoveFxAILogicBasic(this);
  202. // ProDispose();
  203. // // timeLineEventParticleLogicBasic?.Dispose();
  204. // ObjectPoolInterface = null;
  205. // timeLineEventParticleLogicBasic = null;
  206. // attTarget = null;
  207. // ObjectPoolInterface = null;
  208. // _fxAiDataBasic = null;
  209. // _isUpdateBasic = false;
  210. // UnityRenderUpdateComponent.Instance.RemoveICombatUpdate(this);
  211. // CombatFactoryTool.Instance.Recycle(scName, this);
  212. // }
  213. //
  214. // protected virtual void ProInit()
  215. // {
  216. // }
  217. //
  218. // protected virtual void ProCombatUpdate(float time)
  219. // {
  220. // }
  221. //
  222. // protected virtual void ProUnityRenderUpdate(float time)
  223. // {
  224. // }
  225. //
  226. // protected virtual void ProDispose()
  227. // {
  228. // }
  229. //
  230. //
  231. // public RepotLogInfo CurrFrameRepotLogInfo()
  232. // {
  233. // RepotLogInfo repotLogInfo = new RepotLogInfo();
  234. // repotLogInfo.key = timeLineEventParticleLogicBasic.timeLinePlayFxSerializtion.fxName + InitGuid;
  235. // repotLogInfo.currFrameAlterValue.Add("pos_x", CurrPos.x.m_rawValue);
  236. // repotLogInfo.currFrameAlterValue.Add("pos_y", CurrPos.y.m_rawValue);
  237. // repotLogInfo.currFrameAlterValue.Add("rot_x", rotation.x.m_rawValue);
  238. // repotLogInfo.currFrameAlterValue.Add("rot_y", rotation.y.m_rawValue);
  239. // repotLogInfo.currFrameAlterValue.Add("rot_z", rotation.z.m_rawValue);
  240. //
  241. // return repotLogInfo;
  242. // }
  243. //
  244. //
  245. //
  246. // }
  247. // }