public void OnHeroHpChange(PoolObjHandle <ActorRoot> hero, int curVal, int maxVal) { if (hero != 0) { for (int i = 0; i < this.heroHeads.Length; i++) { PlayerHead head = this.heroHeads[i]; if ((head.MyHero != 0) && (head.MyHero == hero)) { head.OnHeroHpChange(curVal, maxVal); break; } } } }
public void OnHeroHpChange(PoolObjHandle <ActorRoot> hero, int curVal, int maxVal) { if (!hero) { return; } for (int i = 0; i < this.heroHeads.Length; i++) { PlayerHead playerHead = this.heroHeads[i]; if (playerHead.MyHero && playerHead.MyHero == hero) { playerHead.OnHeroHpChange(curVal, maxVal); break; } } }