From 9c5a734ad70114513f9fc59ea009a904285da4db Mon Sep 17 00:00:00 2001 From: taoria <445625470@qq.com> Date: Thu, 4 Aug 2022 16:28:58 +0800 Subject: [PATCH] refactor:rename [ShowInNodeView] Attribute to [ShowInNode] and start to make a better graph creator tool --- TNode/GraphCreator.meta | 3 +++ TNode/GraphCreator/Editor.meta | 3 +++ TNode/GraphCreator/Editor/GraphCreator.cs | 7 +++++++ TNode/GraphCreator/Editor/GraphCreator.cs.meta | 3 +++ TNode/GraphCreator/Runtime.meta | 3 +++ TNode/GraphCreator/Runtime/Blackboard.meta | 3 +++ .../Runtime/Blackboard/GraphMetaBlackboard.cs | 9 +++++++++ .../Blackboard/GraphMetaBlackboard.cs.meta | 3 +++ TNode/GraphCreator/Runtime/GraphMetaNode.cs | 1 + .../GraphCreator/Runtime/GraphMetaNode.cs.meta | 3 +++ TNode/GraphCreator/Runtime/MetaGraph.cs | 6 ++++++ TNode/GraphCreator/Runtime/MetaGraph.cs.meta | 3 +++ TNode/GraphCreator/Runtime/Nodes.meta | 3 +++ .../GraphCreator/Runtime/Nodes/GraphMetaNode.cs | 17 +++++++++++++++++ .../Runtime/Nodes/GraphMetaNode.cs.meta | 3 +++ TNode/TNodeCore/Editor/GraphCreatorEditor.cs | 8 ++++++++ .../TNodeCore/Editor/GraphCreatorEditor.cs.meta | 3 +++ ...ShowInNodeViewAttribute.cs => ShowInNode.cs} | 2 +- ...ViewAttribute.cs.meta => ShowInNode.cs.meta} | 0 .../Editor/Inspector/NodeInspectorInNode.cs | 2 +- 20 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 TNode/GraphCreator.meta create mode 100644 TNode/GraphCreator/Editor.meta create mode 100644 TNode/GraphCreator/Editor/GraphCreator.cs create mode 100644 TNode/GraphCreator/Editor/GraphCreator.cs.meta create mode 100644 TNode/GraphCreator/Runtime.meta create mode 100644 TNode/GraphCreator/Runtime/Blackboard.meta create mode 100644 TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs create mode 100644 TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs.meta create mode 100644 TNode/GraphCreator/Runtime/GraphMetaNode.cs create mode 100644 TNode/GraphCreator/Runtime/GraphMetaNode.cs.meta create mode 100644 TNode/GraphCreator/Runtime/MetaGraph.cs create mode 100644 TNode/GraphCreator/Runtime/MetaGraph.cs.meta create mode 100644 TNode/GraphCreator/Runtime/Nodes.meta create mode 100644 TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs create mode 100644 TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs.meta create mode 100644 TNode/TNodeCore/Editor/GraphCreatorEditor.cs create mode 100644 TNode/TNodeCore/Editor/GraphCreatorEditor.cs.meta rename TNode/TNodeCore/Runtime/Attributes/{ShowInNodeViewAttribute.cs => ShowInNode.cs} (72%) rename TNode/TNodeCore/Runtime/Attributes/{ShowInNodeViewAttribute.cs.meta => ShowInNode.cs.meta} (100%) diff --git a/TNode/GraphCreator.meta b/TNode/GraphCreator.meta new file mode 100644 index 0000000..ba7ab38 --- /dev/null +++ b/TNode/GraphCreator.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b880945b54834ff892ab441f95ebf64a +timeCreated: 1659601013 \ No newline at end of file diff --git a/TNode/GraphCreator/Editor.meta b/TNode/GraphCreator/Editor.meta new file mode 100644 index 0000000..f7c19cb --- /dev/null +++ b/TNode/GraphCreator/Editor.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 088ae3752f0e44ad91bf019cc64536fc +timeCreated: 1659601180 \ No newline at end of file diff --git a/TNode/GraphCreator/Editor/GraphCreator.cs b/TNode/GraphCreator/Editor/GraphCreator.cs new file mode 100644 index 0000000..3d407ee --- /dev/null +++ b/TNode/GraphCreator/Editor/GraphCreator.cs @@ -0,0 +1,7 @@ +using TNodeCore.Editor; + +namespace TNode.GraphCreator.Editor{ + public class GraphCreator:GraphEditor{ + + } +} \ No newline at end of file diff --git a/TNode/GraphCreator/Editor/GraphCreator.cs.meta b/TNode/GraphCreator/Editor/GraphCreator.cs.meta new file mode 100644 index 0000000..154b52a --- /dev/null +++ b/TNode/GraphCreator/Editor/GraphCreator.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b727fc33cca34734bff028a952645808 +timeCreated: 1659601005 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime.meta b/TNode/GraphCreator/Runtime.meta new file mode 100644 index 0000000..54ae4bd --- /dev/null +++ b/TNode/GraphCreator/Runtime.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e10ab803f7cf4762b5e72874dc3a69a0 +timeCreated: 1659601201 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/Blackboard.meta b/TNode/GraphCreator/Runtime/Blackboard.meta new file mode 100644 index 0000000..e9c39d9 --- /dev/null +++ b/TNode/GraphCreator/Runtime/Blackboard.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3a0683e43c164065927b50fc72d9065c +timeCreated: 1659601323 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs b/TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs new file mode 100644 index 0000000..77fc56b --- /dev/null +++ b/TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs @@ -0,0 +1,9 @@ +using TNodeCore.Editor.EditorPersistence; +using TNodeCore.Runtime.Models; + +namespace TNode.GraphCreator.Runtime.Blackboard{ + public class GraphMetaBlackboard:BlackboardData{ + + + } +} \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs.meta b/TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs.meta new file mode 100644 index 0000000..34c15a3 --- /dev/null +++ b/TNode/GraphCreator/Runtime/Blackboard/GraphMetaBlackboard.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 33c75ee828f4484abbe9009859357182 +timeCreated: 1659601335 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/GraphMetaNode.cs b/TNode/GraphCreator/Runtime/GraphMetaNode.cs new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/TNode/GraphCreator/Runtime/GraphMetaNode.cs @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/GraphMetaNode.cs.meta b/TNode/GraphCreator/Runtime/GraphMetaNode.cs.meta new file mode 100644 index 0000000..12301c7 --- /dev/null +++ b/TNode/GraphCreator/Runtime/GraphMetaNode.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e4bc602c13c042819a553d6142faf3ba +timeCreated: 1659601223 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/MetaGraph.cs b/TNode/GraphCreator/Runtime/MetaGraph.cs new file mode 100644 index 0000000..61e8d3c --- /dev/null +++ b/TNode/GraphCreator/Runtime/MetaGraph.cs @@ -0,0 +1,6 @@ +using TNodeCore.Runtime.Models; + +namespace TNode.GraphCreator.Editor{ + public class MetaGraph : GraphData{ + } +} \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/MetaGraph.cs.meta b/TNode/GraphCreator/Runtime/MetaGraph.cs.meta new file mode 100644 index 0000000..cf1d517 --- /dev/null +++ b/TNode/GraphCreator/Runtime/MetaGraph.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e0047d8d81f646128eab9c94957129f4 +timeCreated: 1659601169 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/Nodes.meta b/TNode/GraphCreator/Runtime/Nodes.meta new file mode 100644 index 0000000..13eef7b --- /dev/null +++ b/TNode/GraphCreator/Runtime/Nodes.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a54e22f7a85c4befbf19d09e14259869 +timeCreated: 1659601272 \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs b/TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs new file mode 100644 index 0000000..6accd68 --- /dev/null +++ b/TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs @@ -0,0 +1,17 @@ +using System; +using TNode.GraphCreator.Editor; +using TNodeCore.Runtime.Attributes; + +namespace TNode.GraphCreator.Runtime.Nodes{ + using TNodeCore.Runtime.Models; + + namespace TNode.GraphCreator.Runtime{ + [GraphUsage(typeof(MetaGraph))] + [Serializable] + public class GraphMetaNode:NodeData{ + [ShowInNode] + public string createNodeName; + + } + } +} \ No newline at end of file diff --git a/TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs.meta b/TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs.meta new file mode 100644 index 0000000..fc03282 --- /dev/null +++ b/TNode/GraphCreator/Runtime/Nodes/GraphMetaNode.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3f00e9ec34ac442da5e7b7b21042e37b +timeCreated: 1659601280 \ No newline at end of file diff --git a/TNode/TNodeCore/Editor/GraphCreatorEditor.cs b/TNode/TNodeCore/Editor/GraphCreatorEditor.cs new file mode 100644 index 0000000..6839b2a --- /dev/null +++ b/TNode/TNodeCore/Editor/GraphCreatorEditor.cs @@ -0,0 +1,8 @@ +using UnityEditor; + +namespace TNodeCore.Editor{ + public class GraphCreatorEditor:EditorWindow{ + + + } +} \ No newline at end of file diff --git a/TNode/TNodeCore/Editor/GraphCreatorEditor.cs.meta b/TNode/TNodeCore/Editor/GraphCreatorEditor.cs.meta new file mode 100644 index 0000000..6f01de2 --- /dev/null +++ b/TNode/TNodeCore/Editor/GraphCreatorEditor.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 059e73589b764d7db8e53b75c86d634d +timeCreated: 1659600695 \ No newline at end of file diff --git a/TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/ShowInNode.cs similarity index 72% rename from TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/ShowInNode.cs index 405c6e8..43eae09 100644 --- a/TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs +++ b/TNode/TNodeCore/Runtime/Attributes/ShowInNode.cs @@ -3,7 +3,7 @@ namespace TNodeCore.Runtime.Attributes{ [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)] - public class ShowInNodeViewAttribute:System.Attribute{ + public class ShowInNode:System.Attribute{ } } \ No newline at end of file diff --git a/TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/ShowInNode.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/ShowInNode.cs.meta diff --git a/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs b/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs index 66eb4f9..a8ce005 100644 --- a/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs +++ b/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs @@ -46,7 +46,7 @@ namespace TNode.TNodeGraphViewImpl.Editor.Inspector{ foreach (var field in _data.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public|BindingFlags.NonPublic)){ //Create corresponding property field //check if the field has ShowInNodeView attribute - var showInNodeViewAttribute = field.GetCustomAttribute() != null; + var showInNodeViewAttribute = field.GetCustomAttribute() != null; if (!showInNodeViewAttribute) continue; var drawer = new PropertyField(serializedObject.FindProperty("data").FindPropertyRelative(field.Name));