1
0
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:
Thor Brigsted 2017-11-05 23:42:31 +01:00
parent 6fcd16abd7
commit c6a4735c71
19 changed files with 1339 additions and 1324 deletions

View File

@ -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 {

View File

@ -1,4 +1,6 @@
namespace BasicNodes {
using XNode;
namespace BasicNodes {
public class DisplayValue : Node {
[Input(ShowBackingValue.Never)] public object value;

View File

@ -1,7 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEditor;
using XNodeEditor;
namespace BasicNodes {
[CustomNodeEditor(typeof(DisplayValue))]

View File

@ -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

View File

@ -1,4 +1,5 @@
using UnityEngine;
using XNode;
namespace BasicNodes {
public class Vector : Node {

View File

@ -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;
}
}
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}
}

View File

@ -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();
}
}
}

View File

@ -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;
}
}
}

View File

@ -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];
}
}
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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 {
}
}
}
}

View File

@ -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 {
}
}
}
}

View File

@ -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();
}
}
}

View File

@ -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 {
}
}
}
}