diff --git a/TNode/Attribute/NodeComponentAttribute.cs b/TNode/Attribute/NodeComponentAttribute.cs index 8d718df..2a3c660 100644 --- a/TNode/Attribute/NodeComponentAttribute.cs +++ b/TNode/Attribute/NodeComponentAttribute.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; using JetBrains.Annotations; -using TNode.BaseViews; + namespace TNode.Attribute{ diff --git a/TNode/BaseModels.meta b/TNode/BaseModels.meta new file mode 100644 index 0000000..58d544d --- /dev/null +++ b/TNode/BaseModels.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 54cbaedb5bd248f68813368e888d8854 +timeCreated: 1655969230 \ No newline at end of file diff --git a/TNode/BaseModels/IEditorOnlyModel.cs b/TNode/BaseModels/IEditorOnlyModel.cs new file mode 100644 index 0000000..086ca5c --- /dev/null +++ b/TNode/BaseModels/IEditorOnlyModel.cs @@ -0,0 +1,5 @@ +namespace TNode.BaseModels{ + public interface IEditorOnlyModel{ + + } +} \ No newline at end of file diff --git a/TNode/BaseModels/IEditorOnlyModel.cs.meta b/TNode/BaseModels/IEditorOnlyModel.cs.meta new file mode 100644 index 0000000..2199be5 --- /dev/null +++ b/TNode/BaseModels/IEditorOnlyModel.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 051a8933e6bf4b4ebdff2df9be042774 +timeCreated: 1655969265 \ No newline at end of file diff --git a/TNode/BaseModels/Model.cs b/TNode/BaseModels/Model.cs new file mode 100644 index 0000000..da5a36c --- /dev/null +++ b/TNode/BaseModels/Model.cs @@ -0,0 +1,5 @@ +namespace TNode.BaseModels{ + public interface IModel{ + + } +} \ No newline at end of file diff --git a/TNode/BaseViews.meta b/TNode/Editor/BaseViews.meta similarity index 100% rename from TNode/BaseViews.meta rename to TNode/Editor/BaseViews.meta diff --git a/TNode/BaseViews/DataGraphView.cs b/TNode/Editor/BaseViews/DataGraphView.cs similarity index 91% rename from TNode/BaseViews/DataGraphView.cs rename to TNode/Editor/BaseViews/DataGraphView.cs index 4ee0067..1bd6d14 100644 --- a/TNode/BaseViews/DataGraphView.cs +++ b/TNode/Editor/BaseViews/DataGraphView.cs @@ -1,5 +1,5 @@ - -using TNode.Tools; +using TNode.Cache; +using TNode.Models; using UnityEditor.Experimental.GraphView; using UnityEngine; using UnityEngine.UIElements; @@ -46,14 +46,15 @@ namespace TNode.BaseViews{ } //A Constructor for the DataGraphView ,never to override it public DataGraphView(){ + + styleSheets.Add(Resources.Load("GraphViewBackground")); + var grid = new GridBackground(); + Insert(0,grid); + grid.StretchToParentSize(); this.AddManipulator(new ContentDragger()); this.AddManipulator(new SelectionDragger()); this.AddManipulator(new RectangleSelector()); SetupZoom(ContentZoomer.DefaultMinScale, ContentZoomer.DefaultMaxScale); - - //Default Color - style.backgroundColor = new Color(0.1f, 0.1f, 0.1f, 1); - // ReSharper disable once VirtualMemberCallInConstructor OnInit(); } //OnDataChanged event diff --git a/TNode/BaseViews/DataGraphView.cs.meta b/TNode/Editor/BaseViews/DataGraphView.cs.meta similarity index 100% rename from TNode/BaseViews/DataGraphView.cs.meta rename to TNode/Editor/BaseViews/DataGraphView.cs.meta diff --git a/TNode/Editor/BaseViews/NodeInspector.cs b/TNode/Editor/BaseViews/NodeInspector.cs new file mode 100644 index 0000000..81936d1 --- /dev/null +++ b/TNode/Editor/BaseViews/NodeInspector.cs @@ -0,0 +1,22 @@ +using TNode.Models; +using UnityEditor.Experimental.GraphView; + +namespace TNode.BaseViews{ + public class NodeInspector:SimpleGraphSubWindow{ + private NodeData _data; + + public NodeData Data{ + get => _data; + set{ + _data = value; + UpdateData(); + } + } + + private void UpdateData(){ + if (_data != null){ + + } + } + } +} \ No newline at end of file diff --git a/TNode/Editor/BaseViews/NodeInspector.cs.meta b/TNode/Editor/BaseViews/NodeInspector.cs.meta new file mode 100644 index 0000000..ae987c9 --- /dev/null +++ b/TNode/Editor/BaseViews/NodeInspector.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e0febc13b11349779178ce0ac30c1773 +timeCreated: 1655965285 \ No newline at end of file diff --git a/TNode/BaseViews/NodeView.cs b/TNode/Editor/BaseViews/NodeView.cs similarity index 96% rename from TNode/BaseViews/NodeView.cs rename to TNode/Editor/BaseViews/NodeView.cs index 6e44db5..a2596f8 100644 --- a/TNode/BaseViews/NodeView.cs +++ b/TNode/Editor/BaseViews/NodeView.cs @@ -1,4 +1,5 @@ using Dialogue; +using TNode.Models; using UnityEditor.Experimental.GraphView; namespace TNode.BaseViews{ diff --git a/TNode/BaseViews/NodeView.cs.meta b/TNode/Editor/BaseViews/NodeView.cs.meta similarity index 100% rename from TNode/BaseViews/NodeView.cs.meta rename to TNode/Editor/BaseViews/NodeView.cs.meta diff --git a/TNode/BaseViews/SimpleGraphSubWindow.cs b/TNode/Editor/BaseViews/SimpleGraphSubWindow.cs similarity index 99% rename from TNode/BaseViews/SimpleGraphSubWindow.cs rename to TNode/Editor/BaseViews/SimpleGraphSubWindow.cs index 25fb8cd..9402842 100644 --- a/TNode/BaseViews/SimpleGraphSubWindow.cs +++ b/TNode/Editor/BaseViews/SimpleGraphSubWindow.cs @@ -25,11 +25,9 @@ namespace TNode.BaseViews{ BuildWindow(uxml); } } - public SimpleGraphSubWindow(VisualTreeAsset visualTreeAsset){ ConstructWindowBasicSetting(); BuildWindow(visualTreeAsset); } - } } \ No newline at end of file diff --git a/TNode/BaseViews/SimpleGraphSubWindow.cs.meta b/TNode/Editor/BaseViews/SimpleGraphSubWindow.cs.meta similarity index 100% rename from TNode/BaseViews/SimpleGraphSubWindow.cs.meta rename to TNode/Editor/BaseViews/SimpleGraphSubWindow.cs.meta diff --git a/TNode/Tools.meta b/TNode/Editor/Cache.meta similarity index 100% rename from TNode/Tools.meta rename to TNode/Editor/Cache.meta diff --git a/TNode/Tools/NodeEditorExtensions.cs b/TNode/Editor/Cache/NodeEditorExtensions.cs similarity index 97% rename from TNode/Tools/NodeEditorExtensions.cs rename to TNode/Editor/Cache/NodeEditorExtensions.cs index dfc67ee..7f507d9 100644 --- a/TNode/Tools/NodeEditorExtensions.cs +++ b/TNode/Editor/Cache/NodeEditorExtensions.cs @@ -2,10 +2,9 @@ using System.Collections.Generic; using TNode.Attribute; using TNode.BaseViews; -using UnityEditor.Experimental.GraphView; using UnityEngine; -namespace TNode.Tools{ +namespace TNode.Cache{ internal class NodeEditorSingleton{ private static NodeEditorSingleton _instance; public readonly Dictionary FromGenericToSpecific = new Dictionary(); diff --git a/TNode/Tools/NodeEditorExtensions.cs.meta b/TNode/Editor/Cache/NodeEditorExtensions.cs.meta similarity index 100% rename from TNode/Tools/NodeEditorExtensions.cs.meta rename to TNode/Editor/Cache/NodeEditorExtensions.cs.meta diff --git a/TNode/Editor/GraphEditor.cs b/TNode/Editor/GraphEditor.cs index d5077c5..31aa286 100644 --- a/TNode/Editor/GraphEditor.cs +++ b/TNode/Editor/GraphEditor.cs @@ -1,6 +1,7 @@ using Codice.CM.Common; using TNode.BaseViews; -using TNode.Tools; +using TNode.Cache; +using TNode.Models; using UnityEditor; using UnityEngine; using UnityEngine.Serialization; diff --git a/TNode/Editor/Model.meta b/TNode/Editor/Model.meta new file mode 100644 index 0000000..505afc9 --- /dev/null +++ b/TNode/Editor/Model.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e3bc969c46434a308e20796dede95f3b +timeCreated: 1655969991 \ No newline at end of file diff --git a/TNode/Editor/Model/NodeEditorData.cs b/TNode/Editor/Model/NodeEditorData.cs new file mode 100644 index 0000000..46fb9d9 --- /dev/null +++ b/TNode/Editor/Model/NodeEditorData.cs @@ -0,0 +1,13 @@ +using System; +using UnityEngine; +using UnityEngine.Serialization; + +namespace TNode.Models{ + [Serializable] + public class NodeEditorData where T:NodeData{ + [SerializeReference] + private T nodeData; + + public Rect nodePos; + } +} \ No newline at end of file diff --git a/TNode/Editor/Model/NodeEditorData.cs.meta b/TNode/Editor/Model/NodeEditorData.cs.meta new file mode 100644 index 0000000..f988729 --- /dev/null +++ b/TNode/Editor/Model/NodeEditorData.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: cde084f079a7426daa86ed86cb80ed1b +timeCreated: 1655969362 \ No newline at end of file diff --git a/TNode/Models.meta b/TNode/Models.meta new file mode 100644 index 0000000..efc5c54 --- /dev/null +++ b/TNode/Models.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 90ee74ab34fd41c68901e004060bd6c9 +timeCreated: 1655969326 \ No newline at end of file diff --git a/TNode/GraphData.cs b/TNode/Models/GraphData.cs similarity index 93% rename from TNode/GraphData.cs rename to TNode/Models/GraphData.cs index 79ffdf8..b7b9f07 100644 --- a/TNode/GraphData.cs +++ b/TNode/Models/GraphData.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Dialogue; using UnityEngine; -namespace TNode{ +namespace TNode.Models{ [Serializable] public class GraphData:ScriptableObject{ diff --git a/TNode/GraphData.cs.meta b/TNode/Models/GraphData.cs.meta similarity index 100% rename from TNode/GraphData.cs.meta rename to TNode/Models/GraphData.cs.meta diff --git a/TNode/NodeData.cs b/TNode/Models/NodeData.cs similarity index 75% rename from TNode/NodeData.cs rename to TNode/Models/NodeData.cs index 7dbcec5..0bc833a 100644 --- a/TNode/NodeData.cs +++ b/TNode/Models/NodeData.cs @@ -1,9 +1,10 @@ using System; +using TNode.BaseModels; using UnityEngine; -namespace TNode{ +namespace TNode.Models{ [Serializable] - public class NodeData{ + public class NodeData:IModel{ public NodeData() : base(){ //Object Registration diff --git a/TNode/NodeData.cs.meta b/TNode/Models/NodeData.cs.meta similarity index 100% rename from TNode/NodeData.cs.meta rename to TNode/Models/NodeData.cs.meta diff --git a/TNode/NodeLink.cs b/TNode/Models/NodeLink.cs similarity index 95% rename from TNode/NodeLink.cs rename to TNode/Models/NodeLink.cs index 7eac2df..55266e8 100644 --- a/TNode/NodeLink.cs +++ b/TNode/Models/NodeLink.cs @@ -1,6 +1,7 @@ using System; +using Dialogue; -namespace Dialogue{ +namespace TNode.Models{ //Node links are stored in output side of the two node port. [Serializable] public class NodeLink{ diff --git a/TNode/NodeLink.cs.meta b/TNode/Models/NodeLink.cs.meta similarity index 100% rename from TNode/NodeLink.cs.meta rename to TNode/Models/NodeLink.cs.meta diff --git a/TNode/Resources.meta b/TNode/Resources.meta new file mode 100644 index 0000000..8a40013 --- /dev/null +++ b/TNode/Resources.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: df0b7f32b46d4c8882228c4310c2eb67 +timeCreated: 1655962243 \ No newline at end of file diff --git a/TNode/TNodeSample/GraphViewTest.cs b/TNode/TNodeSample/GraphViewTest.cs index b96ee8c..ce772a5 100644 --- a/TNode/TNodeSample/GraphViewTest.cs +++ b/TNode/TNodeSample/GraphViewTest.cs @@ -1,6 +1,6 @@ using Dialogue; using TNode.Attribute; -using TNode.BaseViews; + namespace TNode.TNodeSample{ diff --git a/TNode/TNodeSample/NodeDataTest.cs b/TNode/TNodeSample/NodeDataTest.cs index 1b08ba0..98c1c51 100644 --- a/TNode/TNodeSample/NodeDataTest.cs +++ b/TNode/TNodeSample/NodeDataTest.cs @@ -1,5 +1,6 @@ using Dialogue; using TNode.Attribute; +using TNode.Models; namespace TNode.TNodeSample{ public class NodeDataTest:NodeData{