// EXECUTABLE: ---------------------------------------------------------------------------- public override bool Check(GameObject target) { GameObject targetGO = this.target.GetGameObject(target); if (!targetGO) { Debug.LogError("Condition Attribute: No target defined"); return(false); } Stats stats = targetGO.GetComponentInChildren <Stats>(); if (!stats) { Debug.LogError("Condition Attribute: Could not get Stats component in target", targetGO); return(false); } switch (this.compare) { case Comparison.ValueIsGreaterOrEqual: return(stats.GetAttrValue(this.attribute.attribute.uniqueName) >= this.value.GetValue(target)); case Comparison.ValueIsLessOrEqual: return(stats.GetAttrValue(this.attribute.attribute.uniqueName) <= this.value.GetValue(target)); case Comparison.PercentIsGreaterOrEqual: return(stats.GetAttrValuePercent(this.attribute.attribute.uniqueName) >= this.percent); case Comparison.PercentIsLessOrEqual: return(stats.GetAttrValuePercent(this.attribute.attribute.uniqueName) <= this.percent); } return(false); }