//construct with PropertyInfo void ConstructWithProperty(PropertyInfo targetProperty, Type type, string memberPath, string transformPath) { if (!supportedTypes.Contains(targetProperty.PropertyType)) { Debug.LogError(string.Format("Type '{0}' is not supported for animation", targetProperty.PropertyType)); return; } if (!targetProperty.CanRead || !targetProperty.CanWrite) { Debug.LogError("Animated Property must be able to both read and write"); return; } if (targetProperty.RTGetGetMethod().IsStatic) { Debug.LogError("Static Properties are not supported"); return; } var newData = new SerializationMetaData(); newData.parameterType = ParameterType.Property; newData.parameterName = memberPath; newData.declaringTypeName = type.FullName; newData.transformHierarchyPath = transformPath; serializedData = JsonUtility.ToJson(newData); InitializeCurves(); }
//construct with FieldInfo void ConstructWithField(FieldInfo targetField, Transform child, Transform root) { if (!supportedTypes.Contains(targetField.FieldType)) { Debug.LogError(string.Format("Type '{0}' is not supported for animation", targetField.FieldType)); return; } if (targetField.IsStatic) { Debug.LogError("Static Fields are not supported"); return; } var newData = new SerializationMetaData(); newData.parameterType = ParameterType.Field; newData.parameterName = targetField.Name; newData.declaringTypeName = targetField.RTReflectedType().FullName; if (child != null && root != null) { newData.transformHierarchyPath = CalculateTransformPath(root, child); } serializedData = JsonUtility.ToJson(newData); InitializeCurves(); }
//construct with PropertyInfo void ConstructWithProperty(PropertyInfo targetProperty, Transform child, Transform root) { if (!supportedTypes.Contains(targetProperty.PropertyType)) { Debug.LogError(string.Format("Type '{0}' is not supported for animation", targetProperty.PropertyType)); return; } if (!targetProperty.CanRead || !targetProperty.CanWrite) { Debug.LogError("Animated Property must be able to both read and write"); return; } if (targetProperty.RTGetGetMethod().IsStatic) { Debug.LogError("Static Properties are not supported"); return; } var newData = new SerializationMetaData(); newData.parameterType = ParameterType.Property; newData.parameterName = targetProperty.Name; newData.declaringTypeName = targetProperty.RTReflectedType().FullName; if (child != null && root != null) { newData.transformHierarchyPath = CalculateTransformPath(root, child); } serializedData = JsonUtility.ToJson(newData); InitializeCurves(); }
//construct with FieldInfo void ConstructWithField(FieldInfo targetField, Type type, string memberPath, string transformPath) { if (!supportedTypes.Contains(targetField.FieldType)) { Debug.LogError(string.Format("Type '{0}' is not supported for animation", targetField.FieldType)); return; } if (targetField.IsStatic) { Debug.LogError("Static Fields are not supported"); return; } var newData = new SerializationMetaData(); newData.parameterType = ParameterType.Field; newData.parameterName = memberPath; newData.declaringTypeName = type.FullName; newData.transformHierarchyPath = transformPath; serializedData = JsonUtility.ToJson(newData); InitializeCurves(); }
public static SerializationQueryStrategy CreateStrategy(ISerializableObject data, SerializationMetaData metaData) { switch (data.SerializationStrategy) { case DEFAULT: return(new UpdateIfDeserializedSerializationQueryStrategy(data, metaData)); case UPDATE_BY_PRIMARYKEY: return(new UpdateByPrimaryKeySerializationQueryStrategy(data)); case INSERT: return(new InsertSerializationQueryStrategy(data)); case REMOVE: return(new RemoveSerializationQueryStrategy(data)); } throw new StrategyNotFoundException("Serialization strategy \"" + data.SerializationStrategy + "\" not found"); }
public UpdateIfDeserializedSerializationQueryStrategy(ISerializableObject data, SerializationMetaData metaData) : base(data) { this._metaData = metaData; }