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); } }
IEnumerator WaitAUpdata(UnitMonoBehaciour unit, float time, float attack) { while (true) { yield return(new WaitForSeconds(time)); if (unit == null) { break; } unit.Damage(attack); } }
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(); }