|
|
|
|
|
|
using UnityEngine.Experimental.UIElements; |
|
|
|
using UnityEditor.Graphing; |
|
|
|
using UnityEditor.ShaderGraph.Drawing.Controls; |
|
|
|
using UnityEngine.Experimental.Rendering; |
|
|
|
using UnityEngine.Experimental.UIElements.StyleEnums; |
|
|
|
using UnityEngine.Experimental.UIElements.StyleSheets; |
|
|
|
using Node = UnityEditor.Experimental.UIElements.GraphView.Node; |
|
|
|
|
|
|
VisualElement m_SettingsButton; |
|
|
|
VisualElement m_Settings; |
|
|
|
VisualElement m_NodeSettingsView; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Initialize(AbstractMaterialNode inNode, PreviewManager previewManager, IEdgeConnectorListener connectorListener) |
|
|
|
|
|
|
if (node is SubGraphNode) |
|
|
|
{ |
|
|
|
RegisterCallback<MouseDownEvent>(OnSubGraphDoubleClick); |
|
|
|
} |
|
|
|
|
|
|
|
var masterNode = node as IMasterNode; |
|
|
|
if (masterNode != null) |
|
|
|
{ |
|
|
|
if (!masterNode.IsPipelineCompatible(RenderPipelineManager.currentPipeline)) |
|
|
|
{ |
|
|
|
IconBadge wrongPipeline = IconBadge.CreateError("The current render pipeline is not compatible with this node preview."); |
|
|
|
Add(wrongPipeline); |
|
|
|
VisualElement title = this.Q("title"); |
|
|
|
wrongPipeline.AttachTo(title, SpriteAlignment.LeftCenter); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
m_PortInputContainer.SendToBack(); |
|
|
|