using System.Collections.Generic; using Fort23.UTool; using GameTimeLine.CustomizeTimeLogic; using UnityEngine; using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface; namespace GameLogic.Combat.Hero { public class CombatHeroHitPoint : ILifetCycleHitPoint { public List allSpecialDotInfo = new List(); public ShowBaiscEntity combatHeroEntity; public SpecialDotInfo MinSpecialDotInfo; private List _loopFx = new List(); public bool IsHide { get; set; } public ILifeCycle IfLifeCycle { get { return combatHeroEntity; } } public Vector3 Position { get { if (_hitPointMono != null) { return _hitPointMono.transform.position; } else { return combatHeroEntity.dotPos; } } } private HitPointMono _hitPointMono; public T This() { return (T)(object)this; } public void Init(ShowBaiscEntity combatHeroEntity, HitPointMono hitPointMono) { this.combatHeroEntity = combatHeroEntity; _hitPointMono = hitPointMono; SpecialDotMono[] specialDotMonos = combatHeroEntity.combatHeroGameObject.GameObjectPool.own .GetComponentsInChildren(true); for (int i = 0; i < specialDotMonos.Length; i++) { SpecialDotMono specialDotMono = specialDotMonos[i]; SpecialDotInfo specialDotInfo = new SpecialDotInfo(); specialDotInfo.dotName = specialDotMono.DotName; specialDotInfo.targetTran = specialDotMono.transform; specialDotInfo.followSkeleton = specialDotMono.followSkeleton; specialDotInfo.heroEntity = combatHeroEntity; allSpecialDotInfo.Add(specialDotInfo); } MinSpecialDotInfo = new SpecialDotInfo(); MinSpecialDotInfo.targetTran = combatHeroEntity.combatHeroGameObject.GameObjectPool.own.transform; MinSpecialDotInfo.heroEntity = combatHeroEntity; } public void Update(float t) { for (int i = 0; i < allSpecialDotInfo.Count; i++) { if (allSpecialDotInfo[i].followSkeleton) { combatHeroEntity.combatHeroAnimtion.SetSpecialDotMonoFollow(allSpecialDotInfo[i]); } } } public SpecialDotInfo GetSpecialDotInfo(string specialDotName) { SpecialDotInfo specialDotInfo = MinSpecialDotInfo; for (int i = 0; i < allSpecialDotInfo.Count; i++) { if (allSpecialDotInfo[i].dotName == specialDotName) { specialDotInfo = allSpecialDotInfo[i]; } } return specialDotInfo; } public void AddLoopFx(ParticleSystemPool particleSystemPool) { _loopFx.Add(particleSystemPool); } public bool IsLoopFx(string fxName) { for (int i = 0; i < _loopFx.Count; i++) { if(_loopFx[i].fxName.Equals(fxName)) { return true; } } return false; } public void RemoveLoopFx(ParticleSystemPool particleSystemPool) { _loopFx.Remove(particleSystemPool); } } }