public override bool HardAttack() { if (!base.HardAttack()) { return(false); } if (skills.hardAttackAttrs.waitTime >= 0) { return(false); } if (weaponCenter.Length == 0) { return(false); } state.IsHardAttack = true; ChangeAnim(anim.hardAttack); if (extendObj.hardAttackParticle != null) { // Bug here GameObject particle = Instantiate(extendObj.hardAttackParticle, weaponCenter[0].position, transform.rotation, transform) as GameObject; Destroy(particle, 1f); } HardAttackAttrs skillAttrs = skills.hardAttackAttrs; foreach (Transform hit in weaponCenter) { Collider[] colliders = Physics.OverlapSphere(hit.position, skillAttrs.radius, 1 << LayerMask.NameToLayer("Character")); foreach (Collider collider in colliders) { if (collider.gameObject.name == this.gameObject.name) { continue; } Character other = collider.gameObject.GetComponent <Character>(); other.TakeDamage(skillAttrs.power); } } skills.hardAttackAttrs.waitTime = 0; return(true); }
public override bool HardAttack() { if (!base.HardAttack()) { return(false); } if (skills.hardAttackAttrs.waitTime >= 0) { return(false); } if (weaponCenter.Length == 0) { return(false); } state.IsHardAttack = true; ChangeAnim(anim.hardAttack); HardAttackAttrs skillAttrs = skills.hardAttackAttrs; skills.hardAttackAttrs.waitTime = 0; return(true); }