protected bool CastSkill() { bool b = true; foreach (var it in commonCd) { b = b && it.timer.isReady(); } if (b && isButtonPressed() && cd.isReady() && resource.HasEnough(cost + minimalEnergy) ) { resource.Spend(cost); foreach (var it in commonCd) { it.timer.restart(); } cd.restart(); return(true); } return(false); }
protected bool CastSkill() { bool b = true; foreach (var it in commonCd) { b = b && it.timer.isReady(); } if (b && Input.GetAxis(buttonCode) > 0.1 && !EventSystem.current.IsPointerOverGameObject() && cd.isReady() && resource.HasEnough(cost + increaseCost.GetVelocity() + minimalEnergy) ) { resource.Spend(cost + increaseCost.GetVelocity()); foreach (var it in commonCd) { it.timer.restart(); } increaseCost.AddForce(increaseCostForce); cd.restart(); return(true); } return(false); }