protected override void onDamage(DamageInfo damage, AttackerAttr attackerAttr) { if (mRes.bossHpUnit > 0) { int curHp = GetHP() < 0 ? 0 : GetHP(); BossBloodUIManager.Instance.ChangeHp(mRes.name, mRes.headicon, GetLevel(), curHp, GetMaxHP(), mRes.bossHpUnit, IsFury()); } if (mBloodNode != null && !IsDead() && damage.Value < 0) { mBloodNode.Show(); } Vector3 headPos = this.GetBonePositionByName("head"); if (headPos != Vector3.zero) { headPos = CameraController.Instance.WorldToScreenPoint(headPos); headPos.z = 0.0f; BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_DAMAGE); evt.pos = headPos; evt.damage = damage; evt.dead = IsDead(); EventSystem.Instance.PushEvent(evt); } base.onDamage(damage, attackerAttr); }
protected override void onDamage(DamageInfo damage, AttackerAttr attackerAttr) { if (mBloodNode != null && !IsDead() && damage.Value < 0) { mBloodNode.Show(); } Vector3 headPos = this.GetBonePositionByName("head"); if (headPos != Vector3.zero) { headPos = CameraController.Instance.WorldToScreenPoint(headPos); headPos.z = 0.0f; BattleUIEvent evt = new BattleUIEvent(BattleUIEvent.BATTLE_UI_PLAYER_DAMAGE); evt.pos = headPos; evt.damage = damage; EventSystem.Instance.PushEvent(evt); } base.onDamage(damage, attackerAttr); }