mirror of
https://github.com/Siccity/xNode.git
synced 2026-02-24 10:41:27 +08:00
Renamed to xNode
Added XNode and XNodeEDitor namespaces Removed unnecessary usings
This commit is contained in:
parent
6fcd16abd7
commit
c6a4735c71
@ -1,7 +1,7 @@
|
|||||||
using System.Collections;
|
using UnityEngine;
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEngine;
|
|
||||||
using System;
|
using System;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
/// <summary> Defines an example nodegraph. </summary>
|
/// <summary> Defines an example nodegraph. </summary>
|
||||||
[Serializable, CreateAssetMenu(fileName = "ExampleNodeGraph", menuName = "Node Graph/Example")]
|
[Serializable, CreateAssetMenu(fileName = "ExampleNodeGraph", menuName = "Node Graph/Example")]
|
||||||
public class ExampleNodeGraph : NodeGraph {
|
public class ExampleNodeGraph : NodeGraph {
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace BasicNodes {
|
using XNode;
|
||||||
|
|
||||||
|
namespace BasicNodes {
|
||||||
public class DisplayValue : Node {
|
public class DisplayValue : Node {
|
||||||
[Input(ShowBackingValue.Never)] public object value;
|
[Input(ShowBackingValue.Never)] public object value;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
using System.Collections;
|
using UnityEditor;
|
||||||
using System.Collections.Generic;
|
using XNodeEditor;
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace BasicNodes {
|
namespace BasicNodes {
|
||||||
[CustomNodeEditor(typeof(DisplayValue))]
|
[CustomNodeEditor(typeof(DisplayValue))]
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
namespace BasicNodes {
|
using XNode;
|
||||||
|
|
||||||
|
namespace BasicNodes {
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class MathNode : Node {
|
public class MathNode : Node {
|
||||||
// Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node
|
// Adding [Input] or [Output] is all you need to do to register a field as a valid port on your node
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
namespace BasicNodes {
|
namespace BasicNodes {
|
||||||
public class Vector : Node {
|
public class Vector : Node {
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
/// <summary> Base class to derive custom Node editors from. Use this to create your own custom inspectors and editors for your nodes. </summary>
|
/// <summary> Base class to derive custom Node editors from. Use this to create your own custom inspectors and editors for your nodes. </summary>
|
||||||
public class NodeEditor {
|
public class NodeEditor {
|
||||||
/// <summary> Fires every whenever a node was modified through the editor </summary>
|
/// <summary> Fires every whenever a node was modified through the editor </summary>
|
||||||
@ -57,3 +58,4 @@ public class CustomNodeEditorAttribute : Attribute {
|
|||||||
_inspectedType = inspectedType;
|
_inspectedType = inspectedType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
public partial class NodeEditorWindow {
|
public partial class NodeEditorWindow {
|
||||||
|
|
||||||
public static bool isPanning { get; private set; }
|
public static bool isPanning { get; private set; }
|
||||||
@ -143,3 +143,4 @@ public partial class NodeEditorWindow {
|
|||||||
return windowRect.Contains(mousePos);
|
return windowRect.Contains(mousePos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
using System.Collections;
|
using UnityEditor;
|
||||||
using System.Collections.Generic;
|
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
public class NodeEditorAssetModProcessor : UnityEditor.AssetModificationProcessor {
|
public class NodeEditorAssetModProcessor : UnityEditor.AssetModificationProcessor {
|
||||||
public static AssetDeleteResult OnWillDeleteAsset(string path, RemoveAssetOptions options) {
|
public static AssetDeleteResult OnWillDeleteAsset(string path, RemoveAssetOptions options) {
|
||||||
UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(path);
|
UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(path);
|
||||||
@ -33,3 +33,4 @@ public class NodeEditorAssetModProcessor : UnityEditor.AssetModificationProcesso
|
|||||||
return AssetDeleteResult.DidNotDelete;
|
return AssetDeleteResult.DidNotDelete;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
/// <summary> Contains GUI methods </summary>
|
/// <summary> Contains GUI methods </summary>
|
||||||
public partial class NodeEditorWindow {
|
public partial class NodeEditorWindow {
|
||||||
|
|
||||||
@ -284,3 +285,4 @@ public partial class NodeEditorWindow {
|
|||||||
} else return hoveredPort.ValueType.ToString();
|
} else return hoveredPort.ValueType.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
/// <summary> UNEC-specific version of <see cref="EditorGUILayout"/> </summary>
|
/// <summary> UNEC-specific version of <see cref="EditorGUILayout"/> </summary>
|
||||||
public static class NodeEditorGUILayout {
|
public static class NodeEditorGUILayout {
|
||||||
|
|
||||||
@ -71,3 +69,4 @@ public static class NodeEditorGUILayout {
|
|||||||
GUI.color = col;
|
GUI.color = col;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
public static class NodeEditorPreferences {
|
public static class NodeEditorPreferences {
|
||||||
|
|
||||||
/// <summary> Have we loaded the prefs yet </summary>
|
/// <summary> Have we loaded the prefs yet </summary>
|
||||||
@ -96,3 +96,4 @@ public static class NodeEditorPreferences {
|
|||||||
return generatedTypeColors[type.Name];
|
return generatedTypeColors[type.Name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -2,8 +2,9 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using UnityEngine;
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
/// <summary> Contains reflection-related info </summary>
|
/// <summary> Contains reflection-related info </summary>
|
||||||
public partial class NodeEditorWindow {
|
public partial class NodeEditorWindow {
|
||||||
[NonSerialized] private static Dictionary<Type, NodeEditor> customNodeEditor;
|
[NonSerialized] private static Dictionary<Type, NodeEditor> customNodeEditor;
|
||||||
@ -48,3 +49,4 @@ public partial class NodeEditorWindow {
|
|||||||
return Activator.CreateInstance(type);
|
return Activator.CreateInstance(type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using UnityEngine;
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
public static class NodeEditorResources {
|
public static class NodeEditorResources {
|
||||||
//Unec textures
|
//Unec textures
|
||||||
public static Texture2D gridTexture { get { return _gridTexture != null ? _gridTexture : _gridTexture = GenerateGridTexture(); } }
|
public static Texture2D gridTexture { get { return _gridTexture != null ? _gridTexture : _gridTexture = GenerateGridTexture(); } }
|
||||||
@ -92,3 +91,4 @@ public static class NodeEditorResources {
|
|||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
/// <summary> A set of editor-only utilities and extensions for UnityNodeEditorBase </summary>
|
/// <summary> A set of editor-only utilities and extensions for UnityNodeEditorBase </summary>
|
||||||
public static class NodeEditorUtilities {
|
public static class NodeEditorUtilities {
|
||||||
|
|
||||||
@ -52,3 +50,4 @@ public static class NodeEditorUtilities {
|
|||||||
return methods.Count() > 0;
|
return methods.Count() > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,10 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Callbacks;
|
using UnityEditor.Callbacks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using XNode;
|
||||||
|
|
||||||
|
namespace XNodeEditor {
|
||||||
[InitializeOnLoad]
|
[InitializeOnLoad]
|
||||||
public partial class NodeEditorWindow : EditorWindow {
|
public partial class NodeEditorWindow : EditorWindow {
|
||||||
public static NodeEditorWindow current;
|
public static NodeEditorWindow current;
|
||||||
@ -95,3 +94,4 @@ public partial class NodeEditorWindow : EditorWindow {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace XNode {
|
||||||
/// <summary> Base class for all nodes </summary>
|
/// <summary> Base class for all nodes </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public abstract class Node : ScriptableObject {
|
public abstract class Node : ScriptableObject {
|
||||||
@ -197,3 +198,4 @@ public abstract class Node : ScriptableObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,10 +1,9 @@
|
|||||||
using System.Collections;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using UnityEditor;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace XNode {
|
||||||
/// <summary> Precaches reflection data in editor so we won't have to do it runtime </summary>
|
/// <summary> Precaches reflection data in editor so we won't have to do it runtime </summary>
|
||||||
public static class NodeDataCache {
|
public static class NodeDataCache {
|
||||||
private static PortDataCache portDataCache;
|
private static PortDataCache portDataCache;
|
||||||
@ -98,3 +97,4 @@ public static class NodeDataCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace XNode {
|
||||||
/// <summary> Base class for all node graphs </summary>
|
/// <summary> Base class for all node graphs </summary>
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public abstract class NodeGraph : ScriptableObject {
|
public abstract class NodeGraph : ScriptableObject {
|
||||||
@ -45,3 +46,4 @@ public abstract class NodeGraph : ScriptableObject {
|
|||||||
nodes.Clear();
|
nodes.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace XNode {
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class NodePort {
|
public class NodePort {
|
||||||
public enum IO { Input, Output }
|
public enum IO { Input, Output }
|
||||||
@ -244,3 +244,4 @@ public class NodePort {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user