浏览代码

Move GraphEditorPresenter creation into method

/main
Peter Bay Bastian 7 年前
当前提交
1f174bad
共有 1 个文件被更改,包括 10 次插入7 次删除
  1. 17
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphEditWindow.cs

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


if (m_GraphEditorView != null)
{
if (m_GraphEditorView.presenter == null)
{
var presenter = CreateInstance<GraphEditorPresenter>();
presenter.Initialize(inMemoryAsset, this, selected.name);
m_GraphEditorView.presenter = presenter;
m_GraphEditorView.RegisterCallback<PostLayoutEvent>(OnPostLayout);
}
CreatePresenter();
m_GraphEditorView.presenter.graphPresenter.UpdateTimeDependentNodes();
}
}

inMemoryAsset.OnEnable();
inMemoryAsset.ValidateGraph();
m_GraphEditorView.presenter = null;
CreatePresenter();
}
void CreatePresenter()
{
var presenter = CreateInstance<GraphEditorPresenter>();
presenter.Initialize(inMemoryAsset, this, selected.name);
m_GraphEditorView.presenter = presenter;
m_GraphEditorView.RegisterCallback<PostLayoutEvent>(OnPostLayout);
}
void OnPostLayout(PostLayoutEvent evt)

正在加载...
取消
保存