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