protected override void UpdateParameter(Parameter parameter) { Transform targetNode = null; if(targeting.target != null) { if(useTargetingSubNode) { Transform t = targeting.target.Find(subNodePath); if(t != null) { targetNode = t; } else { targetNode = targeting.target; } } else { targetNode = targeting.target; } parameter.floatValue = Vector3.Distance(targetNode.position, distanceFrom.position); } else { parameter.floatValue = Mathf.Infinity; } }
public bool HasConditionForParameter(Parameter parameter) { foreach(Condition condition in conditions) { if(condition.parameter == parameter) return true; } return false; }
protected abstract void UpdateParameter(Parameter parameter);
protected abstract void ResetParameter(Parameter parameter);
protected override void ResetParameter(Parameter parameter) { parameter.floatValue = Mathf.Infinity; }
protected override void UpdateParameter(Parameter parameter) { parameter.boolValue = renderer.isVisible; }
protected override void ResetParameter(Parameter parameter) { parameter.boolValue = false; }