mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-06 14:45:06 +08:00
d998763fbe
* feat: add material switcher Also refactor everything... * refactor: simplify object curve handling * refactor: additional refactoring and bugfixes * feat: inverse mode * feat: add material setter inspector UI * chore: set material setter icon * chore: fix error on build * chore: adjust order of inverted element
35 lines
928 B
C#
35 lines
928 B
C#
using UnityEngine;
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor
|
|
{
|
|
struct TargetProp
|
|
{
|
|
public Object TargetObject;
|
|
public string PropertyName;
|
|
|
|
public bool Equals(TargetProp other)
|
|
{
|
|
return Equals(TargetObject, other.TargetObject) && PropertyName == other.PropertyName;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is TargetProp other && Equals(other);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
unchecked
|
|
{
|
|
var hashCode = (TargetObject != null ? TargetObject.GetHashCode() : 0);
|
|
hashCode = (hashCode * 397) ^ (PropertyName != null ? PropertyName.GetHashCode() : 0);
|
|
return hashCode;
|
|
}
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{TargetObject}.{PropertyName}";
|
|
}
|
|
}
|
|
} |