using System.Collections.Generic; using GameTimeLine.CustomizeTimeLogic; using UnityEngine; using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface; namespace GameLogic.Combat.Hero { public class CombatHeroHitPoint : ILifetCycleHitPoint { public List allSpecialDotInfo = new List(); public CombatHeroEntity combatHeroEntity; public SpecialDotInfo MinSpecialDotInfo; public ILifeCycle IfLifeCycle { get { return combatHeroEntity; } } public Vector3 Position { get { return _hitPointMono.transform.position; } } private HitPointMono _hitPointMono; public T This() { return (T)(object)this; } public void Init(CombatHeroEntity 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.heroEntity = combatHeroEntity; allSpecialDotInfo.Add(specialDotInfo); } MinSpecialDotInfo = new SpecialDotInfo(); MinSpecialDotInfo.targetTran = combatHeroEntity.combatHeroGameObject.GameObjectPool.own.transform; MinSpecialDotInfo.heroEntity = combatHeroEntity; } public SpecialDotInfo GetSpecialDotInfo(string specialDotName) { for (int i = 0; i < allSpecialDotInfo.Count; i++) { if (allSpecialDotInfo[i].dotName == specialDotName) { return allSpecialDotInfo[i]; } } return MinSpecialDotInfo; } } }