public void SetValue(object value, Type type = null) { if (value != null) { ParameterType = type == null?value.GetType().FullName : type.FullName; if (ParameterType == typeof(string).FullName) { StringValue = value.ToString(); } else if (value is bool || value is Boolean) { BoolValue = Convert.ToBoolean(value); } else if (IsNumeric(ParameterType)) { NumericValue = Convert.ToSingle(value); } else if (value is UnityEngine.Object) { ObjectUniqueName = ((UnityEngine.Object)value).name; } else if (value is NPCAffordance) { Affordance = (NPCAffordance)value; } else if (value is NPCAssertion) { Assertion = (NPCAssertion)value; } } }
public override void Initialize(object[] parameters) { if (parameters[0] is NPCAssertion) { g_NPCAssertion = ((NPCAssertion)parameters[0]); } else { g_Assertion = (Func <bool>)parameters[0]; } }
public NPCAssert(NPCAssertion Assertion) : base() { g_Assertion = Assertion.Evaluate; }