您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
41 行
1.0 KiB
41 行
1.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.ShaderGraph;
|
|
|
|
namespace UnityEditor.Graphing
|
|
{
|
|
enum ModificationScope
|
|
{
|
|
Nothing = 0,
|
|
Node = 1,
|
|
Graph = 2,
|
|
Topological = 3,
|
|
Layout = 4
|
|
}
|
|
|
|
delegate void OnNodeModified(AbstractMaterialNode node, ModificationScope scope);
|
|
|
|
static class NodeExtensions
|
|
{
|
|
public static IEnumerable<T> GetSlots<T>(this AbstractMaterialNode node) where T : ISlot
|
|
{
|
|
var slots = new List<T>();
|
|
node.GetSlots(slots);
|
|
return slots;
|
|
}
|
|
|
|
public static IEnumerable<T> GetInputSlots<T>(this AbstractMaterialNode node) where T : ISlot
|
|
{
|
|
var slots = new List<T>();
|
|
node.GetInputSlots(slots);
|
|
return slots;
|
|
}
|
|
|
|
public static IEnumerable<T> GetOutputSlots<T>(this AbstractMaterialNode node) where T : ISlot
|
|
{
|
|
var slots = new List<T>();
|
|
node.GetOutputSlots(slots);
|
|
return slots;
|
|
}
|
|
}
|
|
}
|