diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-08-20 23:40:50 -0400 |
| commit | 3af4c218c0e70167db23a6303d2af30aff37d2fe (patch) | |
| tree | 927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/AnimatedParameterCache.cs | |
| parent | b6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff) | |
| download | Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2 Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip | |
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/AnimatedParameterCache.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/AnimatedParameterCache.cs | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/AnimatedParameterCache.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/AnimatedParameterCache.cs deleted file mode 100644 index d5f091f..0000000 --- a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Utilities/AnimatedParameterCache.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace UnityEditor.Timeline -{ - static class AnimatedParameterCache - { - static readonly Dictionary<Type, FieldInfo[]> k_ScriptPlayableFieldsCache = new Dictionary<Type, FieldInfo[]>(); - static readonly Dictionary<PropertyKey, FieldInfo> k_PropertyFieldInfoCache = new Dictionary<PropertyKey, FieldInfo>(); - static readonly Dictionary<PropertyKey, bool> k_PropertyIsAnimatableCache = new Dictionary<PropertyKey, bool>(); - static readonly Dictionary<PropertyKey, string> k_BindingNameCache = new Dictionary<PropertyKey, string>(); - - public static bool TryGetScriptPlayableFields(Type type, out FieldInfo[] scriptPlayableFields) - { - return k_ScriptPlayableFieldsCache.TryGetValue(type, out scriptPlayableFields); - } - - public static void SetScriptPlayableFields(Type type, FieldInfo[] scriptPlayableFields) - { - k_ScriptPlayableFieldsCache[type] = scriptPlayableFields; - } - - public static bool TryGetFieldInfoForProperty(SerializedProperty property, out FieldInfo fieldInfo) - { - return k_PropertyFieldInfoCache.TryGetValue(new PropertyKey(property), out fieldInfo); - } - - public static void SetFieldInfoForProperty(SerializedProperty property, FieldInfo fieldInfo) - { - k_PropertyFieldInfoCache[new PropertyKey(property)] = fieldInfo; - } - - public static bool TryGetIsPropertyAnimatable(SerializedProperty property, out bool isAnimatable) - { - return k_PropertyIsAnimatableCache.TryGetValue(new PropertyKey(property), out isAnimatable); - } - - public static void SetIsPropertyAnimatable(SerializedProperty property, bool isAnimatable) - { - k_PropertyIsAnimatableCache[new PropertyKey(property)] = isAnimatable; - } - - public static bool TryGetBindingName(Type type, string path, out string bindingName) - { - return k_BindingNameCache.TryGetValue(new PropertyKey(type, path), out bindingName); - } - - public static void SetBindingName(Type type, string path, string bindingName) - { - k_BindingNameCache[new PropertyKey(type, path)] = bindingName; - } - } - - struct PropertyKey : IEquatable<PropertyKey> - { - readonly Type m_Type; - readonly string m_Path; - - public PropertyKey(SerializedProperty property) - { - m_Type = property.serializedObject.targetObject.GetType(); - m_Path = property.propertyPath; - } - - public PropertyKey(Type type, string path) - { - m_Type = type; - m_Path = path; - } - - public bool Equals(PropertyKey other) - { - return m_Type == other.m_Type && string.Equals(m_Path, other.m_Path); - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - return obj is PropertyKey && Equals((PropertyKey)obj); - } - - public override int GetHashCode() - { - unchecked - { - return ((m_Type != null ? m_Type.GetHashCode() : 0) * 397) ^ (m_Path != null ? m_Path.GetHashCode() : 0); - } - } - } -} |
