Exemplo n.º 1
0
 /// <summary>
 /// Check if node setup is valid
 /// </summary>
 /// <returns>Returns true if node is configured correctly</returns>
 public virtual bool IsValid()
 {
     #if UNITY_EDITOR
     System.Reflection.FieldInfo[] propertyInfos = this.GetType().GetFields();
     for (int i = 0; i < propertyInfos.Length; i++)
     {
         if (propertyInfos[i].FieldType.IsSubclassOf(typeof(BaseVariableReference)))
         {
             BaseVariableReference varReference = propertyInfos[i].GetValue(this) as BaseVariableReference;
             if (varReference != null && varReference.isInvalid)
             {
                 return(false);
             }
         }
     }
     #endif
     return(true);
 }
Exemplo n.º 2
0
 private static bool IsInvalid(BaseVariableReference variable)
 {
     // Custom validation to allow null objects without warnings
     return((variable.isConstant)? false : variable.blackboard == null || string.IsNullOrEmpty(variable.key));
 }