Exemplo n.º 1
0
 public void Deserialize()
 {
     declaringType = ReflectionTools.GetType(declaringTypeName);
     if (declaringType != null)
     {
         property     = ReflectionTools.GetRelativeMember(declaringType, parameterName) as PropertyInfo;
         field        = ReflectionTools.GetRelativeMember(declaringType, parameterName) as FieldInfo;
         animatedType = property != null ? property.PropertyType : field != null ? field.FieldType : null;
     }
 }
Exemplo n.º 2
0
        ///Creates a new animated parameter out of a member info that optionaly exists on a component in child transform of root transform.
        public AnimatedParameter(IKeyable keyable, Type type, string memberPath, string transformPath)
        {
            this.keyable = keyable;
            var member = ReflectionTools.GetRelativeMember(type, memberPath);

            if (member is PropertyInfo)
            {
                ConstructWithProperty((PropertyInfo)member, type, memberPath, transformPath);
                return;
            }
            if (member is FieldInfo)
            {
                ConstructWithField((FieldInfo)member, type, memberPath, transformPath);
                return;
            }
            Debug.LogError("MemberInfo provided is neither Property, nor Field, or can't be found.");
        }