From d1c496abee8a83f2c05e0a9a61eaaa3aa01e9f20 Mon Sep 17 00:00:00 2001 From: taoria <445625470@qq.com> Date: Tue, 26 Jul 2022 09:31:43 +0800 Subject: [PATCH 1/4] refactor: add a package.json --- TNode/TNodeCore/{ => Editor}/GraphEditor.cs | 0 .../{ => Editor}/GraphEditor.cs.meta | 0 TNode/TNodeCore/{ => Runtime}/Attribute.meta | 0 .../Attribute/DisableOnInspector.cs | 0 .../Attribute/DisableOnInspector.cs.meta | 0 .../Attribute/GraphUsageAttribute.cs | 0 .../Attribute/GraphUsageAttribute.cs.meta | 0 .../Attribute/InternalUsageAttribute.cs | 0 .../Attribute/InternalUsageAttribute.cs.meta | 0 .../{ => Runtime}/Attribute/NodeAttribute.cs | 0 .../Attribute/NodeAttribute.cs.meta | 0 .../Attribute/PortTypeConversion.cs | 0 .../Attribute/PortTypeConversion.cs.meta | 0 .../{ => Runtime}/Attribute/Ports.meta | 0 .../Attribute/Ports/BatchInputAttribute.cs | 0 .../Ports/BatchInputAttribute.cs.meta | 0 .../Attribute/Ports/BatchOutputAttribute.cs | 0 .../Ports/BatchOutputAttribute.cs.meta | 0 .../Attribute/Ports/InputAttribute.cs | 0 .../Attribute/Ports/InputAttribute.cs.meta | 0 .../Attribute/Ports/OutputAttribute.cs | 0 .../Attribute/Ports/OutputAttribute.cs.meta | 0 .../Attribute/Ports/PortAttribute.cs | 0 .../Attribute/Ports/PortAttribute.cs.meta | 0 .../Attribute/RuntimeNodeAttribute.cs | 0 .../Attribute/RuntimeNodeAttribute.cs.meta | 0 .../Attribute/ShowInNodeViewAttribute.cs | 0 .../Attribute/ShowInNodeViewAttribute.cs.meta | 0 .../Attribute/ViewComponentAttribute.cs | 0 .../Attribute/ViewComponentAttribute.cs.meta | 0 TNode/TNodeCore/{ => Runtime}/Components.meta | 0 .../Components/RuntimeDataSaver.cs | 0 .../Components/RuntimeDataSaver.cs.meta | 0 .../{ => Runtime}/Components/RuntimeGraph.cs | 0 .../Components/RuntimeGraph.cs.meta | 0 TNode/TNodeCore/{ => Runtime}/DataWrapper.cs | 0 .../{ => Runtime}/DataWrapper.cs.meta | 0 TNode/TNodeCore/{ => Runtime}/Models.meta | 0 .../{ => Runtime}/Models/BlackboardData.cs | 0 .../Models/BlackboardData.cs.meta | 0 .../Models/BlackboardDragNodeData.cs | 0 .../Models/BlackboardDragNodeData.cs.meta | 0 .../{ => Runtime}/Models/GraphData.cs | 0 .../{ => Runtime}/Models/GraphData.cs.meta | 0 .../TNodeCore/{ => Runtime}/Models/IModel.cs | 0 .../{ => Runtime}/Models/IModel.cs.meta | 0 .../{ => Runtime}/Models/NodeData.cs | 0 .../{ => Runtime}/Models/NodeData.cs.meta | 0 .../{ => Runtime}/Models/NodeLink.cs | 0 .../{ => Runtime}/Models/NodeLink.cs.meta | 0 .../{ => Runtime}/Models/PortInfo.cs | 0 .../{ => Runtime}/Models/PortInfo.cs.meta | 0 .../Models/SceneObjectWrapper.cs | 0 .../Models/SceneObjectWrapper.cs.meta | 0 .../TNodeCore/{ => Runtime}/RuntimeCache.meta | 0 .../RuntimeCache/IModelPropertyAccessor.cs | 0 .../IModelPropertyAccessor.cs.meta | 0 .../RuntimeCache/RuntimeCache.cs | 0 .../RuntimeCache/RuntimeCache.cs.meta | 0 TNode/package.json | 20 +++++++++++++++++++ TNode/package.json.meta | 7 +++++++ 61 files changed, 27 insertions(+) rename TNode/TNodeCore/{ => Editor}/GraphEditor.cs (100%) rename TNode/TNodeCore/{ => Editor}/GraphEditor.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/DisableOnInspector.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/DisableOnInspector.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/GraphUsageAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/GraphUsageAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/InternalUsageAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/InternalUsageAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/NodeAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/NodeAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/PortTypeConversion.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/PortTypeConversion.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/BatchInputAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/BatchInputAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/BatchOutputAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/BatchOutputAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/InputAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/InputAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/OutputAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/OutputAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/PortAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/Ports/PortAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/RuntimeNodeAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/RuntimeNodeAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/ShowInNodeViewAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/ShowInNodeViewAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/ViewComponentAttribute.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Attribute/ViewComponentAttribute.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Components.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Components/RuntimeDataSaver.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Components/RuntimeDataSaver.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Components/RuntimeGraph.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Components/RuntimeGraph.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/DataWrapper.cs (100%) rename TNode/TNodeCore/{ => Runtime}/DataWrapper.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/BlackboardData.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/BlackboardData.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/BlackboardDragNodeData.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/BlackboardDragNodeData.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/GraphData.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/GraphData.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/IModel.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/IModel.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/NodeData.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/NodeData.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/NodeLink.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/NodeLink.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/PortInfo.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/PortInfo.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/Models/SceneObjectWrapper.cs (100%) rename TNode/TNodeCore/{ => Runtime}/Models/SceneObjectWrapper.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/RuntimeCache.meta (100%) rename TNode/TNodeCore/{ => Runtime}/RuntimeCache/IModelPropertyAccessor.cs (100%) rename TNode/TNodeCore/{ => Runtime}/RuntimeCache/IModelPropertyAccessor.cs.meta (100%) rename TNode/TNodeCore/{ => Runtime}/RuntimeCache/RuntimeCache.cs (100%) rename TNode/TNodeCore/{ => Runtime}/RuntimeCache/RuntimeCache.cs.meta (100%) create mode 100644 TNode/package.json create mode 100644 TNode/package.json.meta diff --git a/TNode/TNodeCore/GraphEditor.cs b/TNode/TNodeCore/Editor/GraphEditor.cs similarity index 100% rename from TNode/TNodeCore/GraphEditor.cs rename to TNode/TNodeCore/Editor/GraphEditor.cs diff --git a/TNode/TNodeCore/GraphEditor.cs.meta b/TNode/TNodeCore/Editor/GraphEditor.cs.meta similarity index 100% rename from TNode/TNodeCore/GraphEditor.cs.meta rename to TNode/TNodeCore/Editor/GraphEditor.cs.meta diff --git a/TNode/TNodeCore/Attribute.meta b/TNode/TNodeCore/Runtime/Attribute.meta similarity index 100% rename from TNode/TNodeCore/Attribute.meta rename to TNode/TNodeCore/Runtime/Attribute.meta diff --git a/TNode/TNodeCore/Attribute/DisableOnInspector.cs b/TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs similarity index 100% rename from TNode/TNodeCore/Attribute/DisableOnInspector.cs rename to TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs diff --git a/TNode/TNodeCore/Attribute/DisableOnInspector.cs.meta b/TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/DisableOnInspector.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs.meta diff --git a/TNode/TNodeCore/Attribute/GraphUsageAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/GraphUsageAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs diff --git a/TNode/TNodeCore/Attribute/GraphUsageAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/GraphUsageAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/InternalUsageAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/InternalUsageAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs diff --git a/TNode/TNodeCore/Attribute/InternalUsageAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/InternalUsageAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/NodeAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/NodeAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs diff --git a/TNode/TNodeCore/Attribute/NodeAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/NodeAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/PortTypeConversion.cs b/TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs similarity index 100% rename from TNode/TNodeCore/Attribute/PortTypeConversion.cs rename to TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs diff --git a/TNode/TNodeCore/Attribute/PortTypeConversion.cs.meta b/TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/PortTypeConversion.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs.meta diff --git a/TNode/TNodeCore/Attribute/Ports.meta b/TNode/TNodeCore/Runtime/Attribute/Ports.meta similarity index 100% rename from TNode/TNodeCore/Attribute/Ports.meta rename to TNode/TNodeCore/Runtime/Attribute/Ports.meta diff --git a/TNode/TNodeCore/Attribute/Ports/BatchInputAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/BatchInputAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs diff --git a/TNode/TNodeCore/Attribute/Ports/BatchInputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/BatchInputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/Ports/BatchOutputAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/BatchOutputAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs diff --git a/TNode/TNodeCore/Attribute/Ports/BatchOutputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/BatchOutputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/Ports/InputAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/InputAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs diff --git a/TNode/TNodeCore/Attribute/Ports/InputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/InputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/Ports/OutputAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/OutputAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs diff --git a/TNode/TNodeCore/Attribute/Ports/OutputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/OutputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/Ports/PortAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/PortAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs diff --git a/TNode/TNodeCore/Attribute/Ports/PortAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/Ports/PortAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/RuntimeNodeAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/RuntimeNodeAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs diff --git a/TNode/TNodeCore/Attribute/RuntimeNodeAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/RuntimeNodeAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/ShowInNodeViewAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/ShowInNodeViewAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs diff --git a/TNode/TNodeCore/Attribute/ShowInNodeViewAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/ShowInNodeViewAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs.meta diff --git a/TNode/TNodeCore/Attribute/ViewComponentAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs similarity index 100% rename from TNode/TNodeCore/Attribute/ViewComponentAttribute.cs rename to TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs diff --git a/TNode/TNodeCore/Attribute/ViewComponentAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Attribute/ViewComponentAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs.meta diff --git a/TNode/TNodeCore/Components.meta b/TNode/TNodeCore/Runtime/Components.meta similarity index 100% rename from TNode/TNodeCore/Components.meta rename to TNode/TNodeCore/Runtime/Components.meta diff --git a/TNode/TNodeCore/Components/RuntimeDataSaver.cs b/TNode/TNodeCore/Runtime/Components/RuntimeDataSaver.cs similarity index 100% rename from TNode/TNodeCore/Components/RuntimeDataSaver.cs rename to TNode/TNodeCore/Runtime/Components/RuntimeDataSaver.cs diff --git a/TNode/TNodeCore/Components/RuntimeDataSaver.cs.meta b/TNode/TNodeCore/Runtime/Components/RuntimeDataSaver.cs.meta similarity index 100% rename from TNode/TNodeCore/Components/RuntimeDataSaver.cs.meta rename to TNode/TNodeCore/Runtime/Components/RuntimeDataSaver.cs.meta diff --git a/TNode/TNodeCore/Components/RuntimeGraph.cs b/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs similarity index 100% rename from TNode/TNodeCore/Components/RuntimeGraph.cs rename to TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs diff --git a/TNode/TNodeCore/Components/RuntimeGraph.cs.meta b/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs.meta similarity index 100% rename from TNode/TNodeCore/Components/RuntimeGraph.cs.meta rename to TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs.meta diff --git a/TNode/TNodeCore/DataWrapper.cs b/TNode/TNodeCore/Runtime/DataWrapper.cs similarity index 100% rename from TNode/TNodeCore/DataWrapper.cs rename to TNode/TNodeCore/Runtime/DataWrapper.cs diff --git a/TNode/TNodeCore/DataWrapper.cs.meta b/TNode/TNodeCore/Runtime/DataWrapper.cs.meta similarity index 100% rename from TNode/TNodeCore/DataWrapper.cs.meta rename to TNode/TNodeCore/Runtime/DataWrapper.cs.meta diff --git a/TNode/TNodeCore/Models.meta b/TNode/TNodeCore/Runtime/Models.meta similarity index 100% rename from TNode/TNodeCore/Models.meta rename to TNode/TNodeCore/Runtime/Models.meta diff --git a/TNode/TNodeCore/Models/BlackboardData.cs b/TNode/TNodeCore/Runtime/Models/BlackboardData.cs similarity index 100% rename from TNode/TNodeCore/Models/BlackboardData.cs rename to TNode/TNodeCore/Runtime/Models/BlackboardData.cs diff --git a/TNode/TNodeCore/Models/BlackboardData.cs.meta b/TNode/TNodeCore/Runtime/Models/BlackboardData.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/BlackboardData.cs.meta rename to TNode/TNodeCore/Runtime/Models/BlackboardData.cs.meta diff --git a/TNode/TNodeCore/Models/BlackboardDragNodeData.cs b/TNode/TNodeCore/Runtime/Models/BlackboardDragNodeData.cs similarity index 100% rename from TNode/TNodeCore/Models/BlackboardDragNodeData.cs rename to TNode/TNodeCore/Runtime/Models/BlackboardDragNodeData.cs diff --git a/TNode/TNodeCore/Models/BlackboardDragNodeData.cs.meta b/TNode/TNodeCore/Runtime/Models/BlackboardDragNodeData.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/BlackboardDragNodeData.cs.meta rename to TNode/TNodeCore/Runtime/Models/BlackboardDragNodeData.cs.meta diff --git a/TNode/TNodeCore/Models/GraphData.cs b/TNode/TNodeCore/Runtime/Models/GraphData.cs similarity index 100% rename from TNode/TNodeCore/Models/GraphData.cs rename to TNode/TNodeCore/Runtime/Models/GraphData.cs diff --git a/TNode/TNodeCore/Models/GraphData.cs.meta b/TNode/TNodeCore/Runtime/Models/GraphData.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/GraphData.cs.meta rename to TNode/TNodeCore/Runtime/Models/GraphData.cs.meta diff --git a/TNode/TNodeCore/Models/IModel.cs b/TNode/TNodeCore/Runtime/Models/IModel.cs similarity index 100% rename from TNode/TNodeCore/Models/IModel.cs rename to TNode/TNodeCore/Runtime/Models/IModel.cs diff --git a/TNode/TNodeCore/Models/IModel.cs.meta b/TNode/TNodeCore/Runtime/Models/IModel.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/IModel.cs.meta rename to TNode/TNodeCore/Runtime/Models/IModel.cs.meta diff --git a/TNode/TNodeCore/Models/NodeData.cs b/TNode/TNodeCore/Runtime/Models/NodeData.cs similarity index 100% rename from TNode/TNodeCore/Models/NodeData.cs rename to TNode/TNodeCore/Runtime/Models/NodeData.cs diff --git a/TNode/TNodeCore/Models/NodeData.cs.meta b/TNode/TNodeCore/Runtime/Models/NodeData.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/NodeData.cs.meta rename to TNode/TNodeCore/Runtime/Models/NodeData.cs.meta diff --git a/TNode/TNodeCore/Models/NodeLink.cs b/TNode/TNodeCore/Runtime/Models/NodeLink.cs similarity index 100% rename from TNode/TNodeCore/Models/NodeLink.cs rename to TNode/TNodeCore/Runtime/Models/NodeLink.cs diff --git a/TNode/TNodeCore/Models/NodeLink.cs.meta b/TNode/TNodeCore/Runtime/Models/NodeLink.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/NodeLink.cs.meta rename to TNode/TNodeCore/Runtime/Models/NodeLink.cs.meta diff --git a/TNode/TNodeCore/Models/PortInfo.cs b/TNode/TNodeCore/Runtime/Models/PortInfo.cs similarity index 100% rename from TNode/TNodeCore/Models/PortInfo.cs rename to TNode/TNodeCore/Runtime/Models/PortInfo.cs diff --git a/TNode/TNodeCore/Models/PortInfo.cs.meta b/TNode/TNodeCore/Runtime/Models/PortInfo.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/PortInfo.cs.meta rename to TNode/TNodeCore/Runtime/Models/PortInfo.cs.meta diff --git a/TNode/TNodeCore/Models/SceneObjectWrapper.cs b/TNode/TNodeCore/Runtime/Models/SceneObjectWrapper.cs similarity index 100% rename from TNode/TNodeCore/Models/SceneObjectWrapper.cs rename to TNode/TNodeCore/Runtime/Models/SceneObjectWrapper.cs diff --git a/TNode/TNodeCore/Models/SceneObjectWrapper.cs.meta b/TNode/TNodeCore/Runtime/Models/SceneObjectWrapper.cs.meta similarity index 100% rename from TNode/TNodeCore/Models/SceneObjectWrapper.cs.meta rename to TNode/TNodeCore/Runtime/Models/SceneObjectWrapper.cs.meta diff --git a/TNode/TNodeCore/RuntimeCache.meta b/TNode/TNodeCore/Runtime/RuntimeCache.meta similarity index 100% rename from TNode/TNodeCore/RuntimeCache.meta rename to TNode/TNodeCore/Runtime/RuntimeCache.meta diff --git a/TNode/TNodeCore/RuntimeCache/IModelPropertyAccessor.cs b/TNode/TNodeCore/Runtime/RuntimeCache/IModelPropertyAccessor.cs similarity index 100% rename from TNode/TNodeCore/RuntimeCache/IModelPropertyAccessor.cs rename to TNode/TNodeCore/Runtime/RuntimeCache/IModelPropertyAccessor.cs diff --git a/TNode/TNodeCore/RuntimeCache/IModelPropertyAccessor.cs.meta b/TNode/TNodeCore/Runtime/RuntimeCache/IModelPropertyAccessor.cs.meta similarity index 100% rename from TNode/TNodeCore/RuntimeCache/IModelPropertyAccessor.cs.meta rename to TNode/TNodeCore/Runtime/RuntimeCache/IModelPropertyAccessor.cs.meta diff --git a/TNode/TNodeCore/RuntimeCache/RuntimeCache.cs b/TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs similarity index 100% rename from TNode/TNodeCore/RuntimeCache/RuntimeCache.cs rename to TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs diff --git a/TNode/TNodeCore/RuntimeCache/RuntimeCache.cs.meta b/TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs.meta similarity index 100% rename from TNode/TNodeCore/RuntimeCache/RuntimeCache.cs.meta rename to TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs.meta diff --git a/TNode/package.json b/TNode/package.json new file mode 100644 index 0000000..f0ab86a --- /dev/null +++ b/TNode/package.json @@ -0,0 +1,20 @@ +{ + "name": "com.taoria.t-node", + "version": "0.0.1", + "displayName": "T-Node", + "description": "A graph edition tool for unity", + "unity": "2022.1", + "unityRelease": "0b5", + "dependencies": { + }, + "keywords": [ + "graph", + "node", + "wrapper" + ], + "author": { + "name": "taoria", + "email": "445625470@qq.com", + "url": "taoria@github.io" + } +} \ No newline at end of file diff --git a/TNode/package.json.meta b/TNode/package.json.meta new file mode 100644 index 0000000..272a06f --- /dev/null +++ b/TNode/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3838bc14242907547b72a73ef55ce0e0 +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From 00a423e2abfa6a1888ba2964db3fd86c28dc1b48 Mon Sep 17 00:00:00 2001 From: taoria <445625470@qq.com> Date: Tue, 26 Jul 2022 09:34:27 +0800 Subject: [PATCH 2/4] refactor: no more TextMesh Pro --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 057baf1..6604425 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /Dialogue/ +/TextMesh Pro/ \ No newline at end of file From e8947b7df4c27792f1c566ccfc996ccc0e69d2aa Mon Sep 17 00:00:00 2001 From: taoria <445625470@qq.com> Date: Wed, 27 Jul 2022 13:52:30 +0800 Subject: [PATCH 3/4] feature: runtime cache for running a batch of node --- .../Attribute/Ports/BatchInputAttribute.cs | 5 -- .../{Attribute.meta => Attributes.meta} | 0 .../DisableOnInspector.cs | 0 .../DisableOnInspector.cs.meta | 0 .../GraphUsageAttribute.cs | 0 .../GraphUsageAttribute.cs.meta | 0 .../InternalUsageAttribute.cs | 0 .../InternalUsageAttribute.cs.meta | 0 .../NodeAttribute.cs | 0 .../NodeAttribute.cs.meta | 0 .../PortTypeConversion.cs | 0 .../PortTypeConversion.cs.meta | 0 .../{Attribute => Attributes}/Ports.meta | 0 .../Attributes/Ports/BatchInputAttribute.cs | 5 ++ .../Ports/BatchInputAttribute.cs.meta | 0 .../Ports/BatchOutputAttribute.cs | 0 .../Ports/BatchOutputAttribute.cs.meta | 0 .../Ports/InputAttribute.cs | 0 .../Ports/InputAttribute.cs.meta | 0 .../Ports/OutputAttribute.cs | 0 .../Ports/OutputAttribute.cs.meta | 0 .../Ports/PortAttribute.cs | 1 + .../Ports/PortAttribute.cs.meta | 0 .../RuntimeNodeAttribute.cs | 0 .../RuntimeNodeAttribute.cs.meta | 0 .../ShowInNodeViewAttribute.cs | 0 .../ShowInNodeViewAttribute.cs.meta | 0 .../ViewComponentAttribute.cs | 0 .../ViewComponentAttribute.cs.meta | 0 .../Runtime/Components/RuntimeGraph.cs | 65 +++++++++++++++---- .../Runtime/RuntimeCache/RuntimeCache.cs | 3 + .../Editor/Inspector/NodeInspectorInNode.cs | 2 +- .../Editor/NodeViews/NodeView.cs | 5 +- 33 files changed, 66 insertions(+), 20 deletions(-) delete mode 100644 TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs rename TNode/TNodeCore/Runtime/{Attribute.meta => Attributes.meta} (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/DisableOnInspector.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/DisableOnInspector.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/GraphUsageAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/GraphUsageAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/InternalUsageAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/InternalUsageAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/NodeAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/NodeAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/PortTypeConversion.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/PortTypeConversion.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports.meta (100%) create mode 100644 TNode/TNodeCore/Runtime/Attributes/Ports/BatchInputAttribute.cs rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/BatchInputAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/BatchOutputAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/BatchOutputAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/InputAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/InputAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/OutputAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/OutputAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/PortAttribute.cs (96%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/Ports/PortAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/RuntimeNodeAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/RuntimeNodeAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/ShowInNodeViewAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/ShowInNodeViewAttribute.cs.meta (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/ViewComponentAttribute.cs (100%) rename TNode/TNodeCore/Runtime/{Attribute => Attributes}/ViewComponentAttribute.cs.meta (100%) diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs b/TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs deleted file mode 100644 index 76217b7..0000000 --- a/TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace TNodeCore.Attribute.Ports{ - public class BatchInputAttribute{ - - } -} \ No newline at end of file diff --git a/TNode/TNodeCore/Runtime/Attribute.meta b/TNode/TNodeCore/Runtime/Attributes.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute.meta rename to TNode/TNodeCore/Runtime/Attributes.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs b/TNode/TNodeCore/Runtime/Attributes/DisableOnInspector.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs rename to TNode/TNodeCore/Runtime/Attributes/DisableOnInspector.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs.meta b/TNode/TNodeCore/Runtime/Attributes/DisableOnInspector.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/DisableOnInspector.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/DisableOnInspector.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/GraphUsageAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/GraphUsageAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/GraphUsageAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/GraphUsageAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/GraphUsageAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/InternalUsageAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/InternalUsageAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/InternalUsageAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/InternalUsageAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/InternalUsageAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/NodeAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/NodeAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/NodeAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/NodeAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/NodeAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs b/TNode/TNodeCore/Runtime/Attributes/PortTypeConversion.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs rename to TNode/TNodeCore/Runtime/Attributes/PortTypeConversion.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs.meta b/TNode/TNodeCore/Runtime/Attributes/PortTypeConversion.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/PortTypeConversion.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/PortTypeConversion.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports.meta b/TNode/TNodeCore/Runtime/Attributes/Ports.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports.meta rename to TNode/TNodeCore/Runtime/Attributes/Ports.meta diff --git a/TNode/TNodeCore/Runtime/Attributes/Ports/BatchInputAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/Ports/BatchInputAttribute.cs new file mode 100644 index 0000000..47f51fd --- /dev/null +++ b/TNode/TNodeCore/Runtime/Attributes/Ports/BatchInputAttribute.cs @@ -0,0 +1,5 @@ +namespace TNode.TNodeCore.Runtime.Attributes.Ports{ + public class BatchInputAttribute{ + + } +} \ No newline at end of file diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/Ports/BatchInputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/BatchInputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/Ports/BatchInputAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/Ports/BatchOutputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/Ports/BatchOutputAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/Ports/BatchOutputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/BatchOutputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/Ports/BatchOutputAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/Ports/InputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/Ports/InputAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/Ports/InputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/InputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/Ports/InputAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/Ports/OutputAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/Ports/OutputAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/Ports/OutputAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/OutputAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/Ports/OutputAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/Ports/PortAttribute.cs similarity index 96% rename from TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/Ports/PortAttribute.cs index fe49e84..d23eb6a 100644 --- a/TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs +++ b/TNode/TNodeCore/Runtime/Attributes/Ports/PortAttribute.cs @@ -22,6 +22,7 @@ namespace TNodeCore.Attribute.Ports{ public readonly string Name; public readonly PortNameHandling NameHandling; public Type HandledType; + public bool Multiple = true; public TypeHandling TypeHandling{ get; set; } public PortAttribute(string name,PortNameHandling nameHandling=PortNameHandling.Auto,TypeHandling typeHandling=TypeHandling.Declared){ this.Name = name; diff --git a/TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/Ports/PortAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/Ports/PortAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/Ports/PortAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/RuntimeNodeAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/RuntimeNodeAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/RuntimeNodeAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/RuntimeNodeAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/RuntimeNodeAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/ShowInNodeViewAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/ShowInNodeViewAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs b/TNode/TNodeCore/Runtime/Attributes/ViewComponentAttribute.cs similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs rename to TNode/TNodeCore/Runtime/Attributes/ViewComponentAttribute.cs diff --git a/TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs.meta b/TNode/TNodeCore/Runtime/Attributes/ViewComponentAttribute.cs.meta similarity index 100% rename from TNode/TNodeCore/Runtime/Attribute/ViewComponentAttribute.cs.meta rename to TNode/TNodeCore/Runtime/Attributes/ViewComponentAttribute.cs.meta diff --git a/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs b/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs index 0cdd8ea..2ac7881 100644 --- a/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs +++ b/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs @@ -17,6 +17,8 @@ namespace TNodeCore.Components{ [NonSerialized] public readonly List TopologicalOrder = new List(); public readonly List EntryNodes = new List(); + public readonly Dictionary OutputCached = new Dictionary(); + private bool _isCachingOutput = false; /// /// elements are read only ,do not modify them /// @@ -30,24 +32,52 @@ namespace TNodeCore.Components{ node.NodeData.Process(); } } - public void DependencyTraversal(RuntimeNode runtimeNode){ + //Cache outport info in the graph tool so that we can directly access it in the traversal + public void StartCachingPort(){ + _isCachingOutput = true; + } + public void EndCachingPort(){ + _isCachingOutput = false; + OutputCached.Clear(); + } + public void ResolveDependency(RuntimeNode runtimeNode,int dependencyLevel=0){ var links = runtimeNode.InputLink; foreach (var link in links){ var outputNode = RuntimeNodes[link.outPort.nodeDataId]; - DependencyTraversal(outputNode); + ResolveDependency(outputNode,dependencyLevel+1); HandlingLink(link); } + + if (dependencyLevel > DependencyLevelMax){ + throw new Exception("Dependency anomaly detected,check if there is a loop in the graph"); + } + + + //if the runtime node has no output ,it will not be processed + if (runtimeNode.OutputLink.Count == 0 && dependencyLevel != 0){ + return; + } runtimeNode.NodeData.Process(); + + } - + + private const int DependencyLevelMax = 1145; + public void HandlingLink(NodeLink nodeLink){ + //out node is node output data + //in node is node receive data var inNode = RuntimeNodes[nodeLink.inPort.nodeDataId]; var outNode = RuntimeNodes[nodeLink.outPort.nodeDataId]; - //out node is node output data - //in node is node receive data - var outValue = outNode.GetOutput(nodeLink.outPort.portEntryName); - + + //TODO looks like this string would be too long to make a cache + + var cachedKey = $"{outNode.NodeData.id}-{nodeLink.inPort.portEntryName}"; + var outValue = OutputCached.ContainsKey(cachedKey) ? OutputCached[cachedKey] : outNode.GetOutput(nodeLink.outPort.portEntryName);; + if (_isCachingOutput){ + OutputCached[cachedKey] = outValue; + } inNode.SetInput(nodeLink.inPort.portEntryName, outValue); } public GraphTool(List list, Dictionary graphNodes){ @@ -125,12 +155,12 @@ namespace TNodeCore.Components{ return null; } //DFS search for resolving dependency - public bool ResolveDependency(NodeData startNode){ + public bool RunOnDependency(NodeData startNode){ if(!_build) Build(); if (_graphTool == null) return false; - _graphTool.DependencyTraversal(Get(startNode)); + _graphTool.ResolveDependency(Get(startNode)); return true; } public bool ResolveDependency(){ @@ -152,10 +182,20 @@ namespace TNodeCore.Components{ } public List GetRuntimeNodesOfType(){ - return RuntimeNodes.Values.Where(x => x.NodeType == typeof(T)).ToList(); + return RuntimeNodes.Values.Where(x => typeof(T).IsAssignableFrom(x.NodeType)).ToList(); } public List GetRuntimeNodesOfType(Type type){ - return RuntimeNodes.Values.Where(x => x.NodeType == type).ToList(); + return RuntimeNodes.Values.Where(x => type.IsAssignableFrom(type)).ToList(); + } + public void RunNodesOfType(Type t){ + var nodes = GetRuntimeNodesOfType(t); + _graphTool.StartCachingPort(); + foreach (var runtimeNode in nodes){ + RunOnDependency(runtimeNode.NodeData); + } + _graphTool.EndCachingPort(); + + } private void ModifyOrCreateOutNode(NodeLink linkData){ var outNodeId = linkData.outPort.nodeDataId; @@ -170,7 +210,7 @@ namespace TNodeCore.Components{ public void OnValidate(){ if(runtimeBlackboardData==null||runtimeBlackboardData.GetType()==typeof(BlackboardData)){ if (graphData != null) - runtimeBlackboardData = graphData.blackboardData.Clone() as BlackboardData; + runtimeBlackboardData = graphData.blackboardData?.Clone() as BlackboardData; } } @@ -186,6 +226,7 @@ namespace TNodeCore.Components{ public void Start(){ Build(); + } public virtual void RuntimeExecute(){ _graphTool.DirectlyTraversal(); diff --git a/TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs b/TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs index 8d0a3e6..d00cfb9 100644 --- a/TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs +++ b/TNode/TNodeCore/Runtime/RuntimeCache/RuntimeCache.cs @@ -267,6 +267,9 @@ namespace TNodeCore.RuntimeCache{ return (T) method.Invoke(data); } public static object GetValue(this IModel data, string path,Type type=null){ + if(!RuntimeCache.Instance.CachedDelegatesForGettingValue.ContainsKey(type??data.GetType())){ + return null; + } var dic = RuntimeCache.Instance.CachedDelegatesForGettingValue[type ?? data.GetType()]; var method = dic.ContainsKey(path) ? dic[path] : null; return method?.Invoke(data); diff --git a/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs b/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs index 8581d05..561a006 100644 --- a/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs +++ b/TNode/TNodeGraphViewImpl/Editor/Inspector/NodeInspectorInNode.cs @@ -80,7 +80,7 @@ namespace TNode.Editor.Inspector{ if(!test.IsRuntimeGraph) return; var runtimeGraph = test.GetRuntimeGraph(); if (runtimeGraph != null){ - var res = runtimeGraph.ResolveDependency(_data); + var res = runtimeGraph.RunOnDependency(_data); } _data.OnTest(); } diff --git a/TNode/TNodeGraphViewImpl/Editor/NodeViews/NodeView.cs b/TNode/TNodeGraphViewImpl/Editor/NodeViews/NodeView.cs index 8fac55f..7f07be9 100644 --- a/TNode/TNodeGraphViewImpl/Editor/NodeViews/NodeView.cs +++ b/TNode/TNodeGraphViewImpl/Editor/NodeViews/NodeView.cs @@ -105,7 +105,8 @@ namespace TNodeGraphViewImpl.Editor.NodeViews{ foreach (var propertyInfo in propertyInfos){ if (propertyInfo.GetCustomAttributes(typeof(OutputAttribute),true).FirstOrDefault() is OutputAttribute attribute){ - Port port = InstantiatePort(Orientation.Horizontal, Direction.Output,Port.Capacity.Multi,BuildPortType(attribute,propertyInfo)); + + Port port = InstantiatePort(Orientation.Horizontal, Direction.Output,attribute.Multiple?Port.Capacity.Multi:Port.Capacity.Single,BuildPortType(attribute,propertyInfo)); this.outputContainer.Add(port); var portName = ObjectNames.NicifyVariableName(BuildPortName(attribute,propertyInfo)); port.portName = portName; @@ -115,7 +116,7 @@ namespace TNodeGraphViewImpl.Editor.NodeViews{ } foreach (var propertyInfo in propertyInfos){ if(propertyInfo.GetCustomAttributes(typeof(InputAttribute),true).FirstOrDefault() is InputAttribute attribute){ - Port port = InstantiatePort(Orientation.Horizontal, Direction.Input,Port.Capacity.Single,BuildPortType(attribute,propertyInfo)); + Port port = InstantiatePort(Orientation.Horizontal, Direction.Input,attribute.Multiple?Port.Capacity.Multi:Port.Capacity.Single,BuildPortType(attribute,propertyInfo)); this.inputContainer.Add(port); var portName = BuildPortName(attribute,propertyInfo); port.portName = portName; From 2676079c24b5d2001ba6ec3c044b265c24915a84 Mon Sep 17 00:00:00 2001 From: taoria <445625470@qq.com> Date: Wed, 27 Jul 2022 14:21:19 +0800 Subject: [PATCH 4/4] refactor: add some comments to help to understand runtime graph --- .../Runtime/Components/RuntimeGraph.cs | 90 +++++++++++++++++-- 1 file changed, 81 insertions(+), 9 deletions(-) diff --git a/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs b/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs index 2ac7881..f890154 100644 --- a/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs +++ b/TNode/TNodeCore/Runtime/Components/RuntimeGraph.cs @@ -7,22 +7,53 @@ using UnityEngine; namespace TNodeCore.Components{ public class RuntimeGraph:MonoBehaviour{ + /// + /// Graph data reference to be used in runtime + /// public GraphData graphData; + /// + /// Runtime copy of scene node data to hold references to scene objects + /// public List sceneNodes; + + /// + /// Map of node id to runtime node + /// public readonly Dictionary RuntimeNodes = new Dictionary(); + /// + /// The graph tool the current runtime graph is using + /// private GraphTool _graphTool; - + /// + /// Inner graph tool to help with graph operations + /// private class GraphTool{ + + /// + /// Topological order of the graph nodes + /// [NonSerialized] public readonly List TopologicalOrder = new List(); + + /// + /// Entry nodes of the graph. These are the nodes that has no input. + /// public readonly List EntryNodes = new List(); + /// + /// Cached data for Dependency traversal. + /// public readonly Dictionary OutputCached = new Dictionary(); + + /// + /// Ssed to detect if the graph tool is caching the output data of the node + /// private bool _isCachingOutput = false; /// /// elements are read only ,do not modify them /// public readonly Dictionary RuntimeNodes; + //Traverse and process all nodes in a topological order,dependency of the node is already resolved.if you want to run specific node,you can use RunNodeDependently instead public void DirectlyTraversal(){ foreach (var node in TopologicalOrder){ var links = node.InputLink; @@ -32,7 +63,12 @@ namespace TNodeCore.Components{ node.NodeData.Process(); } } - //Cache outport info in the graph tool so that we can directly access it in the traversal + + /// + /// Cache out port data in the graph tool so that we can directly access the output. + /// The two function assume there will be no change happens in scene nodes or blackboard referenced data during the running,so in a dependency traversal for some + /// batch of nodes.the nodes could directly access the output data in the graph tool instead of waiting dependency traversal resolve the result of the output. + /// public void StartCachingPort(){ _isCachingOutput = true; } @@ -40,11 +76,17 @@ namespace TNodeCore.Components{ _isCachingOutput = false; OutputCached.Clear(); } - public void ResolveDependency(RuntimeNode runtimeNode,int dependencyLevel=0){ + /// + /// Resolve dependencies by a deep first search,the depended nodes will be processed to satisfy the need of the the given runtime node + /// Note it's a recursive function.if you want directly traverse all nodes with dependency resolved ,use DirectlyTraversal() instead. + /// + /// The node you want to resolve dependency + /// search depth,no need provide a number when use outside + public void RunNodeDependently(RuntimeNode runtimeNode,int dependencyLevel=0){ var links = runtimeNode.InputLink; foreach (var link in links){ var outputNode = RuntimeNodes[link.outPort.nodeDataId]; - ResolveDependency(outputNode,dependencyLevel+1); + RunNodeDependently(outputNode,dependencyLevel+1); HandlingLink(link); } @@ -61,9 +103,14 @@ namespace TNodeCore.Components{ } - + /// + /// Max depth of dependency traversal,in case of some special situation. the dependency level bigger than this number will be considered as a loop. + /// private const int DependencyLevelMax = 1145; - + /// + /// Handling a node link to transfer data from it's output side to the input side + /// + /// Link you want to process public void HandlingLink(NodeLink nodeLink){ //out node is node output data //in node is node receive data @@ -80,6 +127,12 @@ namespace TNodeCore.Components{ } inNode.SetInput(nodeLink.inPort.portEntryName, outValue); } + /// + /// Constructor of the graph tool,it will traverse the graph and build the topological order of the graph. + /// + /// List of nodes you need to traversal to build graph tool + /// Map stores the mapping of node data id to runtime node + public GraphTool(List list, Dictionary graphNodes){ RuntimeNodes = graphNodes; if (list == null) return; @@ -117,10 +170,20 @@ namespace TNodeCore.Components{ } + /// + /// Holding the reference of the blackboard ,but it will be override by the runtime graph + /// [SerializeReference] public BlackboardData runtimeBlackboardData; + /// + /// Check if the runtime graph is build .a built graph has a graph tool set up + /// [NonSerialized] private bool _build = false; + + /// + /// Build the graph tool and other dependencies for the runtime graph + /// public void Build(){ var link = graphData.NodeLinks; @@ -139,6 +202,11 @@ namespace TNodeCore.Components{ _build = true; } + /// + /// Cast the node data to a runtime node + /// + /// Node data you provided + /// public RuntimeNode Get(NodeData nodeData){ if(!_build) Build(); @@ -147,20 +215,24 @@ namespace TNodeCore.Components{ } return null; } - + /// + /// Get the runtime node from an id + /// + /// + /// public RuntimeNode Get(string id){ if (RuntimeNodes.ContainsKey(id)){ return RuntimeNodes[id]; } return null; } - //DFS search for resolving dependency + //DFS search to run a node. public bool RunOnDependency(NodeData startNode){ if(!_build) Build(); if (_graphTool == null) return false; - _graphTool.ResolveDependency(Get(startNode)); + _graphTool.RunNodeDependently(Get(startNode)); return true; } public bool ResolveDependency(){