mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
Removed NodeConnection.cs: Node ports now operate by crossreferencing eachother Changed from separate static classes to partial class Removed UNEC Namespace Added live hover info
21 lines
703 B
C#
21 lines
703 B
C#
using System.Reflection;
|
|
using System.Linq;
|
|
using System;
|
|
|
|
/// <summary> Contains reflection-related info </summary>
|
|
public partial class NodeEditorWindow {
|
|
|
|
public static Type[] nodeTypes { get { return _nodeTypes != null ? _nodeTypes : _nodeTypes = GetNodeTypes(); } }
|
|
private static Type[] _nodeTypes;
|
|
|
|
public static Type[] GetNodeTypes() {
|
|
//Get all classes deriving from Node via reflection
|
|
Type derivedType = typeof(Node);
|
|
Assembly assembly = Assembly.GetAssembly(derivedType);
|
|
return assembly.GetTypes().Where(t =>
|
|
t != derivedType &&
|
|
derivedType.IsAssignableFrom(t)
|
|
).ToArray();
|
|
}
|
|
}
|