浏览代码

#28 Set window title to asset name when window is created

/main
Peter Bay Bastian 7 年前
当前提交
8568c86c
共有 3 个文件被更改,包括 6 次插入10 次删除
  1. 10
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs
  2. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs
  3. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs

10
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs


allowAlwaysRepaint = !allowAlwaysRepaint;
}
public void ChangeSelction(Object newSelection)
public void ChangeSelection(Object newSelection)
{
if (!EditorUtility.IsPersistent(newSelection))
return;

source.Initialize(inMemoryAsset, this);
m_GraphEditorView.presenter = source;
//m_GraphView.StretchToParentSize();
titleContent = new GUIContent(selected.name);
/*if (refocus)
{
focused = false;
m_GraphEditorDrawer.graphView.Schedule (Focus).StartingIn (1).Until (() => focused);
}*/
}
}
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderGraphImporter.cs


if (w.selected == asset)
{
foundWindow = true;
w.Focus();
w.Focus();
}
}

window.Show();
window.ChangeSelction(asset);
window.ChangeSelection(asset);
}
}
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Importers/ShaderSubGraphImporterEditor.cs


{
var window = CreateInstance<SubGraphEditWindow>();
window.Show();
window.ChangeSelction(asset);
window.ChangeSelection(asset);
}
}
}
正在加载...
取消
保存