public void BoomParcitle(GameObject parent, float Damage) { float Scale = Damage / 100; Vector3 vect = new Vector3(1, 1, 1) * Mathf.Clamp(Scale, 3f, 15f); ParticleContorl.Play(ParticleType.boom, parent.transform.position, parent.transform.rotation, vect); }
IEnumerator WaitAUpdata(UnitMonoBehaciour unit, float time, float damage) { yield return(new WaitForSeconds(time)); if (unit != null) { ParticleContorl.Play(ParticleType.Blade, unit.transform); unit.Damage(damage); } }
public IEnumerator Attacking(GameObject go) { OnAttack = true; while (IsTurning()) { yield return(new WaitForSeconds(Time.deltaTime)); } while (go != null) { _Actions.Fire(); UnitMonoBehaciour targetMono = go.GetComponent <UnitMonoBehaciour>(); DoBuff(targetMono); float Damage = Attritube.GetFloat(UnitStaticAttritubeType.Attack) + Attritube.GetFloat(UnitDynamicAttritubeType.AttackAdd); BoomParcitle(go, Damage); targetMono.Damage(Damage); ParticleContorl.Play(ParticleType.fire, FireMouse, Fire.transform); //if (AttackIdel >= 1f) //{ _Actions.Idle(); //} if (go == null) { break; } float idel = Attritube.GetFloat(UnitStaticAttritubeType.AttackSpeed) + Attritube.GetFloat(UnitDynamicAttritubeType.AttackSpeedAdd); yield return(new WaitForSeconds(idel)); } _Actions.Idle(); OnAttack = false; SelectAttackGameObject(); }