modular-avatar/Editor/Animation/EditorCurveBindingComparer.cs
bd_ 57fe84548c
feat: shape changer can respond to multiple parent objects being animated (#916)
* refactor: generalize the shape changer implementation a bit

* feat: shape changer can respond to multiple parent objects being animated

Closes: #865
2024-07-06 21:39:42 -07:00

18 lines
601 B
C#

using System.Collections.Generic;
using UnityEditor;
namespace nadena.dev.modular_avatar.animation
{
internal class EditorCurveBindingComparer : IEqualityComparer<EditorCurveBinding>
{
public bool Equals(UnityEditor.EditorCurveBinding x, UnityEditor.EditorCurveBinding y)
{
return x.path == y.path && x.type == y.type && x.propertyName == y.propertyName;
}
public int GetHashCode(UnityEditor.EditorCurveBinding obj)
{
return obj.path.GetHashCode() ^ obj.type.GetHashCode() ^ obj.propertyName.GetHashCode();
}
}
}