浏览代码

Merge pull request #212 from keijiro/fix-docmenuitem

Small fixes to "Open Documentation" menu item.
/main
GitHub 7 年前
当前提交
f44e12ea
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialGraphView.cs

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialGraphView.cs


evt.menu.AppendAction("Convert To Sub-graph", ConvertToSubgraph, ConvertToSubgraphStatus);
evt.menu.AppendAction("Convert To Inline Node", ConvertToInlineNode, ConvertToInlineNodeStatus);
evt.menu.AppendAction("Convert To Property", ConvertToProperty, ConvertToPropertyStatus);
evt.menu.AppendSeparator();
evt.menu.AppendAction("Open Documentation", SeeDocumentation, SeeDocumentationStatus);
if (selection.OfType<MaterialNodeView>().Count() == 1)
{
evt.menu.AppendSeparator();
evt.menu.AppendAction("Open Documentation", SeeDocumentation, SeeDocumentationStatus);
}
}
else if (evt.target is BlackboardField)
{

ContextualMenu.MenuAction.StatusFlags SeeDocumentationStatus(EventBase eventBase)
{
if (selection.OfType<MaterialNodeView>().Count() > 1)
return ContextualMenu.MenuAction.StatusFlags.Hidden;
if (selection.OfType<MaterialNodeView>().First().node.documentationURL == null)
return ContextualMenu.MenuAction.StatusFlags.Disabled;
return ContextualMenu.MenuAction.StatusFlags.Normal;

正在加载...
取消
保存