浏览代码

Refined `ModificationScope` with `.Topological`

`Topological` represents something that changes the topology of the
graph, i.e. something that causes e.g. edge removal.
/main
Peter Bay Bastian 8 年前
当前提交
70e53ed7
共有 6 个文件被更改,包括 13 次插入9 次删除
  1. 3
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphDataSource.cs
  2. 7
      MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Interfaces/INode.cs
  3. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/DrawData/NodePreviewDrawData.cs
  4. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MasterRemapInputNode.cs
  5. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/RemapMasterNode.cs
  6. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/SubGraphNode.cs

3
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Drawing/AbstractGraphDataSource.cs


drawableNodeData.OnModified(scope);
}
if (scope == ModificationScope.Topological)
UpdateData();
EditorUtility.SetDirty(graphAsset.GetScriptableObject());
}

7
MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Interfaces/INode.cs


{
public enum ModificationScope
{
Nothing,
Node,
Graph
Nothing = 0,
Node = 1,
Graph = 2,
Topological = 3
}
public delegate void OnNodeModified(INode node, ModificationScope scope);

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/DrawData/NodePreviewDrawData.cs


set
{
// External changes can only set the modification scope higher, to prevent missing out on a previously set shader regeneration.
if (m_modificationScope == ModificationScope.Graph || (m_modificationScope == ModificationScope.Node && value == ModificationScope.Nothing))
if (m_modificationScope >= value)
return;
m_modificationScope = value;
}

if (m_modificationScope != ModificationScope.Nothing)
{
bool status = false;
if (m_modificationScope == ModificationScope.Graph)
if (m_modificationScope >= ModificationScope.Graph)
{
previewGenerator.Reset();

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/MasterRemapInputNode.cs


if (onModified != null)
{
onModified(this, ModificationScope.Graph);
onModified(this, ModificationScope.Topological);
}
return -nextSlotId;

if (onModified != null)
{
onModified(this, ModificationScope.Graph);
onModified(this, ModificationScope.Topological);
}
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Remapper/RemapMasterNode.cs


OnEnable();
if (onModified != null)
onModified(this, ModificationScope.Graph);
onModified(this, ModificationScope.Topological);
}
}
#else

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/SubGraphNode.cs


OnEnable();
if (onModified != null)
onModified(this, ModificationScope.Graph);
onModified(this, ModificationScope.Topological);
}
}

正在加载...
取消
保存