浏览代码

Add utility function for calculating hash codes

/main
Peter Bay Bastian 7 年前
当前提交
4f6745e0
共有 2 个文件被更改,包括 11 次插入6 次删除
  1. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/GraphInspectorView.cs
  2. 10
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/UIUtilities.cs

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/GraphInspectorView.cs


return;
}
var presenterHash = 17;
unchecked
{
presenterHash = presenterHash * 31 + (presenter.editor == null ? 79 : presenter.editor.GetHashCode());
presenterHash = presenterHash * 31 + presenter.selectionCount;
}
var presenterHash = UIUtilities.GetHashCode(presenter.editor, presenter.selectionCount);
m_Title.text = presenter.title;

10
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Util/UIUtilities.cs


return true;
}
public static int GetHashCode(params object[] objects)
{
var hashCode = 17;
foreach (var @object in objects)
{
hashCode = hashCode * 31 + (@object == null ? 79 : @object.GetHashCode());
}
return hashCode;
}
}
}
正在加载...
取消
保存