forked from alelievr/NodeGraphProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackNodeViewProvider.cs
More file actions
35 lines (31 loc) · 1.03 KB
/
Copy pathStackNodeViewProvider.cs
File metadata and controls
35 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using UnityEditor;
using System.Collections.Generic;
using System;
using System.Linq;
using UnityEngine;
namespace GraphProcessor
{
public static class StackNodeViewProvider
{
static Dictionary< Type, Type > stackNodeViewPerType = new Dictionary< Type, Type >();
static StackNodeViewProvider()
{
foreach (var t in TypeCache.GetTypesWithAttribute<CustomStackNodeView>())
{
var attr = t.GetCustomAttributes(false).Select(a => a as CustomStackNodeView).FirstOrDefault();
stackNodeViewPerType.Add(attr.stackNodeType, t);
// Debug.Log("Add " + attr.stackNodeType);
}
}
public static Type GetStackNodeCustomViewType(Type stackNodeType)
{
// Debug.Log(stackNodeType);
foreach (var t in stackNodeViewPerType)
{
// Debug.Log(t.Key + " -> " + t.Value);
}
stackNodeViewPerType.TryGetValue(stackNodeType, out var view);
return view;
}
}
}