您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
49 行
1.6 KiB
49 行
1.6 KiB
using UnityEditor.MaterialGraph.Drawing.Inspector;
|
|
using UnityEngine;
|
|
using UnityEngine.Graphing;
|
|
|
|
namespace UnityEditor.MaterialGraph.Drawing
|
|
{
|
|
public class GraphEditorPresenter : ScriptableObject
|
|
{
|
|
[SerializeField]
|
|
TitleBarPresenter m_TitleBarPresenter;
|
|
|
|
[SerializeField]
|
|
MaterialGraphPresenter m_GraphPresenter;
|
|
|
|
[SerializeField]
|
|
GraphInspectorPresenter m_GraphInspectorPresenter;
|
|
|
|
public TitleBarPresenter titleBarPresenter
|
|
{
|
|
get { return m_TitleBarPresenter; }
|
|
set { m_TitleBarPresenter = value; }
|
|
}
|
|
|
|
public MaterialGraphPresenter graphPresenter
|
|
{
|
|
get { return m_GraphPresenter; }
|
|
set { m_GraphPresenter = value; }
|
|
}
|
|
|
|
public GraphInspectorPresenter graphInspectorPresenter
|
|
{
|
|
get { return m_GraphInspectorPresenter; }
|
|
set { m_GraphInspectorPresenter = value; }
|
|
}
|
|
|
|
public void Initialize(IGraph graph, IMaterialGraphEditWindow container, string graphName)
|
|
{
|
|
m_TitleBarPresenter = CreateInstance<TitleBarPresenter>();
|
|
m_TitleBarPresenter.Initialize(container);
|
|
|
|
m_GraphInspectorPresenter = CreateInstance<GraphInspectorPresenter>();
|
|
m_GraphInspectorPresenter.Initialize(graphName);
|
|
|
|
m_GraphPresenter = CreateInstance<MaterialGraphPresenter>();
|
|
m_GraphPresenter.Initialize(graph, container);
|
|
m_GraphPresenter.onSelectionChanged += m_GraphInspectorPresenter.UpdateSelection;
|
|
}
|
|
}
|
|
}
|