public bool CanCast(CharacterProperty owner, CharacterProperty target) { if (!owner.HasEnoughMP(Cost) || (CoodDownLeft > 0)) { return(false); } Transform ProjectileCastPoint = owner.transform.FindChild("ProjectileCastPoint"); Transform CastPoint = (ProjectileCastPoint == null) ? owner.transform : ProjectileCastPoint; float distance = Vector3.Distance(CastPoint.position, target.transform.position); if (distance > MaxRange) { return(false); } return(true); }
public bool CanCastOn(CharacterProperty target) { if (!mOwner.HasEnoughMP(mCost) || (CoodDownLeft > 0)) { return(false); } // if (Type == SkillType.HEAL && target.gameObject.layer != mOwner.gameObject.layer) { // return false; // } Transform ProjectileCastPoint = mOwner.transform.FindChild("ProjectileCastPoint"); Transform CastPoint = (ProjectileCastPoint == null) ? mOwner.transform : ProjectileCastPoint; float distance = Vector3.Distance(CastPoint.position, target.transform.position); if (distance > MaxRange) { return(false); } return(true); }