protected object GetPropertyValue(GameObject gameObject, string path, Type[] acceptableTypes)
        {
            var objVal = PropertyResolver.GetPropertyValueFromString(gameObject,
                                                                     path);

            if (acceptableTypes != null && !acceptableTypes.Contains(objVal.GetType(), new IsTypeComparer()))
            {
                Debug.LogWarning(gameObject.GetType() + "." + thisPropertyPath + " is not acceptable type for the comparer");
            }

            return(objVal);
        }
        public object GetOtherPropertyValue()
        {
            switch (compareToType)
            {
            case CompareToType.CompareToObject:
                return(PropertyResolver.GetPropertyValueFromString(other,
                                                                   otherPropertyPath));

            case CompareToType.CompareToConstantValue:
                return(ConstValue);

            case CompareToType.CompareToNull:
            default:
                return(null);
            }
        }
Пример #3
0
 private static ErrorType DoesPropertyExist(GameObject go, string propertPath)
 {
     try
     {
         PropertyResolver.GetPropertyValueFromString(go,
                                                     propertPath);
         return(ErrorType.None);
     }
     catch (Exception e)
     {
         if (e.InnerException is MissingComponentException)
         {
             return(ErrorType.MissingComponent);
         }
         return(ErrorType.DoesNotExist);
     }
 }
 public object GetPropertyValue()
 {
     return(PropertyResolver.GetPropertyValueFromString(go,
                                                        thisPropertyPath));
 }