浏览代码

Merge pull request #347 from Unity-Technologies/warning-incompatible-pipeline

Warning incompatible pipeline
/main
GitHub 7 年前
当前提交
8a2e5a5e
共有 3 个文件被更改,包括 22 次插入0 次删除
  1. 2
      com.unity.shadergraph/Editor/Data/Nodes/IMasterNode.cs
  2. 6
      com.unity.shadergraph/Editor/Data/Nodes/MasterNode.cs
  3. 14
      com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs

2
com.unity.shadergraph/Editor/Data/Nodes/IMasterNode.cs


using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEngine.Experimental.Rendering;
namespace UnityEditor.ShaderGraph
{

bool IsPipelineCompatible(IRenderPipeline renderPipeline);
}
}

6
com.unity.shadergraph/Editor/Data/Nodes/MasterNode.cs


using UnityEditor.Graphing;
using UnityEditor.Graphing.Util;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph

configuredTextures = shaderProperties.GetConfiguredTexutres();
return finalShader.GetShaderString(0);
}
public bool IsPipelineCompatible(IRenderPipeline renderPipeline)
{
return true;
}
public override void OnBeforeSerialize()

14
com.unity.shadergraph/Editor/Drawing/Views/MaterialNodeView.cs


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();

正在加载...
取消
保存