|
|
|
|
|
|
ToolbarButtonView m_TimeButton; |
|
|
|
ToolbarButtonView m_CopyToClipboardButton; |
|
|
|
|
|
|
|
PreviewSystem m_PreviewSystem; |
|
|
|
PreviewManager m_PreviewManager; |
|
|
|
|
|
|
|
public Action onUpdateAssetClick { get; set; } |
|
|
|
public Action onConvertToSubgraphClick { get; set; } |
|
|
|
|
|
|
|
|
|
|
public PreviewRate previewRate |
|
|
|
{ |
|
|
|
get { return previewSystem.previewRate; } |
|
|
|
set { previewSystem.previewRate = value; } |
|
|
|
get { return previewManager.previewRate; } |
|
|
|
set { previewManager.previewRate = value; } |
|
|
|
public PreviewSystem previewSystem |
|
|
|
public PreviewManager previewManager |
|
|
|
get { return m_PreviewSystem; } |
|
|
|
set { m_PreviewSystem = value; } |
|
|
|
get { return m_PreviewManager; } |
|
|
|
set { m_PreviewManager = value; } |
|
|
|
} |
|
|
|
|
|
|
|
public GraphInspectorView inspectorView |
|
|
|
|
|
|
m_Graph = graph; |
|
|
|
AddStyleSheetPath("Styles/MaterialGraph"); |
|
|
|
|
|
|
|
previewSystem = new PreviewSystem(graph); |
|
|
|
previewManager = new PreviewManager(graph); |
|
|
|
|
|
|
|
m_ToolbarView = new ToolbarView { name = "TitleBar" }; |
|
|
|
{ |
|
|
|
|
|
|
m_GraphView.AddManipulator(new NodeCreator(graph)); |
|
|
|
content.Add(m_GraphView); |
|
|
|
|
|
|
|
m_GraphInspectorView = new GraphInspectorView(asset.name, previewSystem, graph) { name = "inspector" }; |
|
|
|
m_GraphInspectorView = new GraphInspectorView(asset.name, previewManager, graph) { name = "inspector" }; |
|
|
|
m_GraphView.onSelectionChanged += m_GraphInspectorView.UpdateSelection; |
|
|
|
content.Add(m_GraphInspectorView); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddNode(INode node) |
|
|
|
{ |
|
|
|
var nodeView = new MaterialNodeView(node as AbstractMaterialNode, m_PreviewSystem) { userData = node }; |
|
|
|
var nodeView = new MaterialNodeView(node as AbstractMaterialNode, m_PreviewManager) { userData = node }; |
|
|
|
node.onModified += OnNodeChanged; |
|
|
|
m_GraphView.AddElement(nodeView); |
|
|
|
} |
|
|
|
|
|
|
m_GraphView = null; |
|
|
|
} |
|
|
|
if (m_GraphInspectorView != null) m_GraphInspectorView.Dispose(); |
|
|
|
if (previewSystem != null) |
|
|
|
if (previewManager != null) |
|
|
|
previewSystem.Dispose(); |
|
|
|
previewSystem = null; |
|
|
|
previewManager.Dispose(); |
|
|
|
previewManager = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |