浏览代码

Fix issues that should have caused compile errors

/main
Peter Bay Bastian 7 年前
当前提交
ab269bcc
共有 4 个文件被更改,包括 18 次插入17 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/SubGraph/AbstractSubGraph.cs
  2. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/SubGraph/AbstractSubGraphNode.cs
  3. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/ShaderLayerview.cs
  4. 27
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/SubGraph/AbstractSubGraph.cs


, IGeneratesBodyCode
, IGeneratesFunction
{
public virtual IEnumerable<AbstractMaterialNode> activeNodes { get; }
public virtual IEnumerable<AbstractMaterialNode> activeNodes { get { return Enumerable.Empty<AbstractMaterialNode>(); } }
public PreviewMode previewMode
{

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/SubGraph/AbstractSubGraphNode.cs


, IMayRequireTime
{
protected virtual AbstractSubGraph referencedGraph { get; }
protected abstract AbstractSubGraph referencedGraph { get; }
public override bool hasPreview
{

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/ShaderLayerview.cs


{
public class ShaderLayerView : VisualElement
{
public LayeredShaderGraph graph { get; }
public LayeredShaderGraph.Layer layer { get; }
public LayeredShaderGraph graph { get; private set; }
public LayeredShaderGraph.Layer layer { get; private set; }
public ShaderLayerView(LayeredShaderGraph graph, LayeredShaderGraph.Layer layer)
{

27
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphEditWindow.cs


SerializableGraphObject m_GraphObject;
GraphEditorView m_GraphEditorView;
GraphEditorView graphEditorView
{
get { return m_GraphEditorView; }

{
get { return m_GraphObject; }
set
{
{
if (m_GraphObject != null)
DestroyImmediate(m_GraphObject);
m_GraphObject = value;

var e = Event.current;
if (e.type == EventType.ValidateCommand && (
e.commandName == "Copy" && presenter.canCopy
|| e.commandName == "Paste" && presenter.canPaste
|| e.commandName == "Duplicate" && presenter.canDuplicate
|| e.commandName == "Cut" && presenter.canCut
|| (e.commandName == "Delete" || e.commandName == "SoftDelete") && presenter.canDelete))
e.commandName == "Copy" && presenter.canCopy
|| e.commandName == "Paste" && presenter.canPaste
|| e.commandName == "Duplicate" && presenter.canDuplicate
|| e.commandName == "Cut" && presenter.canCut
|| (e.commandName == "Delete" || e.commandName == "SoftDelete") && presenter.canDelete))
{
e.Use();
}

var inputSlotRef = new SlotReference(remappedInputNodeGuid, inputSlot.slotId);
graph.Connect(outputSlotRef, inputSlotRef);
}
// one edge needs to go to outside world
else if (outputRemapExists)
{

var uniqueInputEdges = onlyOutputInternallyConnected.GroupBy(
edge => edge.outputSlot,
edge => edge,
(key, edges) => new {slotRef = key, edges = edges.ToList()});
(key, edges) => new { slotRef = key, edges = edges.ToList() });
foreach (var group in uniqueInputEdges)
{
var sr = group.slotRef;

var uniqueOutputEdges = onlyInputInternallyConnected.GroupBy(
edge => edge.inputSlot,
edge => edge,
(key, edges) => new {slot = key, edges = edges.ToList()});
(key, edges) => new { slot = key, edges = edges.ToList() });
var outputsNeedingConnection = new List<KeyValuePair<IEdge, IEdge>>();
foreach (var group in uniqueOutputEdges)

graphPresenter.graph.AddNode(subGraphNode);
subGraphNode.subGraphAsset = subGraph;
/* foreach (var edgeMap in inputsNeedingConnection)
{
graphPresenter.graph.Connect(edgeMap.Key.outputSlot, new SlotReference(subGraphNode.guid, edgeMap.Value.outputSlot.slotId));
}*/
/* foreach (var edgeMap in inputsNeedingConnection)
{
graphPresenter.graph.Connect(edgeMap.Key.outputSlot, new SlotReference(subGraphNode.guid, edgeMap.Value.outputSlot.slotId));
}*/
foreach (var edgeMap in outputsNeedingConnection)
{

shaderImporter.SaveAndReimport();
AssetDatabase.ImportAsset(path);
}
public void ChangeSelection(Object newSelection, Type graphType)
{

正在加载...
取消
保存