summaryrefslogtreecommitdiffstats
path: root/Scripts/Fold/Editor/FoldGraphView.cs
blob: b8911c1a09a4040132a2343d6955dc4d70959028 (plain)
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
using UnityEngine;
using UnityEditor;
using GraphProcessor;
using System;
using System.Collections.Generic;
using System.Linq;

public class FoldGraphView : BaseGraphView
{
    public FoldGraphView(EditorWindow window) : base(window) {}

    public override IEnumerable<(string path, Type type)> FilterCreateNodeMenuEntries()
    {
      return NodeProvider.GetNodeMenuEntries(graph)
        .Where(entry =>
            typeof(BaseFoldNode).IsAssignableFrom(entry.type) ||
            typeof(KeyframeNode).IsAssignableFrom(entry.type) ||
            // Whitelist a few built in nodes that we use.
            typeof(FloatNode).IsAssignableFrom(entry.type) ||
            typeof(GameObjectNode).IsAssignableFrom(entry.type) ||
            typeof(VectorNode).IsAssignableFrom(entry.type)
            );
    }
}