Merge pull request #46 from taoria/work-in-progress

Work in progress
main
taoria 3 years ago committed by GitHub
commit 79d2b90194
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Samples/HelloGraph.cs
  2. 4
      TNodeCore/Editor/DeveloperHelper/CleanMissingTypeHelper.cs
  3. 2
      TNodeCore/Editor/EditorPersistence/GraphEditorData.cs
  4. 6
      TNodeCore/Editor/Tools/GraphEditorCreator/GraphEditorCreator.cs
  5. 9
      TNodeCore/GraphCreator/Runtime/GraphMetaNode.cs
  6. 2
      TNodeCore/TNodeCore.asmdef
  7. 8
      TNodeGraphViewImpl/Editor/Cache/NodeEditorExtensions.cs
  8. 2
      TNodeGraphViewImpl/TNodeGraphView.asmdef

@ -3,7 +3,7 @@ using TNodeCore.Runtime.Models;
using UnityEngine; using UnityEngine;
namespace Samples{ namespace Samples{
[CreateAssetMenu(fileName = "New HelloGraph", menuName = "TNode/HelloGraph")] [CreateAssetMenu(fileName = "New HelloGraph", menuName = "TNodeCore/HelloGraph")]
[Serializable] [Serializable]
public class HelloGraph : GraphData{ public class HelloGraph : GraphData{

@ -10,7 +10,7 @@ namespace TNode.TNodeCore.Editor.DeveloperHelper{
public static class CleanMissingTypeHelper public static class CleanMissingTypeHelper
{ {
[MenuItem("TNode/CleanMissingType/CleanScriptObjects")] [MenuItem("TNodeCore/CleanMissingType/CleanScriptObjects")]
public static void CleanMissingTypesOnScriptableObjects() public static void CleanMissingTypesOnScriptableObjects()
{ {
var report = new StringBuilder(); var report = new StringBuilder();
@ -38,7 +38,7 @@ namespace TNode.TNodeCore.Editor.DeveloperHelper{
Debug.Log(report.ToString()); Debug.Log(report.ToString());
} }
[MenuItem("TNode/CleanMissingType/CleanSceneGameObjects")] [MenuItem("TNodeCore/CleanMissingType/CleanSceneGameObjects")]
public static void CleanMissingTypesOnGameObjects(){ public static void CleanMissingTypesOnGameObjects(){
var report = new StringBuilder(); var report = new StringBuilder();

@ -11,7 +11,7 @@ namespace TNode.TNodeCore.Editor.EditorPersistence{
/// Graph Editor Data hold the config of a type of graph. /// Graph Editor Data hold the config of a type of graph.
/// it's used by a graph editor to determine which implementation to use and some other config may be stored in here some days later. /// it's used by a graph editor to determine which implementation to use and some other config may be stored in here some days later.
/// </summary> /// </summary>
[CreateAssetMenu(fileName = "Graph Editor Data", menuName = "TNode/Graph Editor Data")] [CreateAssetMenu(fileName = "Graph Editor Data", menuName = "TNodeCore/Graph Editor Data")]
public class GraphEditorData:ScriptableObject{ public class GraphEditorData:ScriptableObject{
/// <summary> /// <summary>
/// The implementation of a graph view.experimental graphview or GTF. /// The implementation of a graph view.experimental graphview or GTF.

@ -6,7 +6,7 @@ using UnityEditor;
using UnityEngine; using UnityEngine;
using UnityEngine.UIElements; using UnityEngine.UIElements;
//add an attribute right click asset panel and select "TNode/Create/Create New Graph Editor" to call this editor //add an attribute right click asset panel and select "TNodeCore/Create/Create New Graph Editor" to call this editor
namespace TNodeCore.Editor.Tools.GraphEditorCreator{ namespace TNodeCore.Editor.Tools.GraphEditorCreator{
@ -20,8 +20,8 @@ namespace TNodeCore.Editor.Tools.GraphEditorCreator{
private TextField _graphClassNameTextField; private TextField _graphClassNameTextField;
private Button _createButton; private Button _createButton;
private readonly SourceGeneratorForGraphEditor _sourceGeneratorForGraphEditor = new SourceGeneratorForGraphEditor(); private readonly SourceGeneratorForGraphEditor _sourceGeneratorForGraphEditor = new SourceGeneratorForGraphEditor();
[MenuItem("Assets/Create/TNode/Create New Graph Editor")] [MenuItem("Assets/Create/TNodeCore/Create New Graph Editor")]
[MenuItem("TNode/Create New Graph Editor")] [MenuItem("TNodeCore/Create New Graph Editor")]
public static void ShowExample() public static void ShowExample()
{ {
GraphEditorCreator wnd = GetWindow<GraphEditorCreator>(); GraphEditorCreator wnd = GetWindow<GraphEditorCreator>();

@ -1 +1,8 @@
 using TNodeCore.Runtime.Models;
namespace TNodeCore.GraphCreator.Runtime{
public class GraphMetaNode : NodeData{
public string NodeName;
}
}

@ -1,3 +1,3 @@
{ {
"name": "NewAssembly" "name": "TNodeCore"
} }

@ -15,7 +15,7 @@ using UnityEngine;
namespace TNodeGraphViewImpl.Editor.Cache{ namespace TNodeGraphViewImpl.Editor.Cache{
/// <summary> /// <summary>
/// Internal singleton class for caching TNode reflection Data. /// Internal singleton class for caching TNodeCore reflection Data.
/// </summary> /// </summary>
internal class NodeEditorTypeDictionary:Dictionary<Type, Type>{ internal class NodeEditorTypeDictionary:Dictionary<Type, Type>{
private class NodeEditorTypeDictionaryComparer : IEqualityComparer<Type>{ private class NodeEditorTypeDictionaryComparer : IEqualityComparer<Type>{
@ -138,8 +138,8 @@ namespace TNodeGraphViewImpl.Editor.Cache{
//fetch this type 's parent class //fetch this type 's parent class
var parent = type.BaseType; var parent = type.BaseType;
//Check if this type is a generic type and is a generic type of BaseNodeView or BaseDataGraphView, //Check if this type is a generic type and is a generic type of BaseNodeView or BaseDataGraphView,
//Two level generic definition is now supported by TNode //Two level generic definition is now supported by TNodeCore
//Deeper nested generic definition is not supported by TNode //Deeper nested generic definition is not supported by TNodeCore
if (parent is{IsGenericType: true} && if (parent is{IsGenericType: true} &&
(_acceptedTypesForGenericToSpecific.Contains(parent.GetGenericTypeDefinition()) || (_acceptedTypesForGenericToSpecific.Contains(parent.GetGenericTypeDefinition()) ||
(parent.GetGenericTypeDefinition().IsGenericType && _acceptedTypesForGenericToSpecific.Contains(parent.GetGenericTypeDefinition().GetGenericTypeDefinition())) (parent.GetGenericTypeDefinition().IsGenericType && _acceptedTypesForGenericToSpecific.Contains(parent.GetGenericTypeDefinition().GetGenericTypeDefinition()))
@ -278,7 +278,7 @@ namespace TNodeGraphViewImpl.Editor.Cache{
public class Launcher{ public class Launcher{
static Launcher(){ static Launcher(){
//Get version of the package //Get version of the package
Debug.Log("TNode v0.01 is launched"); Debug.Log("TNodeCore v0.01 is launched");
NodeEditorSingleton.Instance.Initialize(); NodeEditorSingleton.Instance.Initialize();
} }
} }

@ -1,6 +1,6 @@
{ {
"name": "TNodeGraphView", "name": "TNodeGraphView",
"rootNamespace": "", "rootNamespace": "TNodeGraphView",
"references": [ "references": [
"GUID:d9d6b4f0cdce23345bf2e956f8041ca2" "GUID:d9d6b4f0cdce23345bf2e956f8041ca2"
], ],

Loading…
Cancel
Save