using System; using TNode.Cache; using TNode.Editor.Inspector.InspectorImplementation; using Unity.VisualScripting; using UnityEditor; using UnityEngine; using UnityEngine.UIElements; namespace TNode.Editor.Inspector{ [Obsolete] public class InspectorItemFactory{ public InspectorItem Create(){ //Check type of GraphDataType var hasSpecificType = NodeEditorExtensions.HasSpecificTypeComponent>(); if (hasSpecificType){ return NodeEditorExtensions.CreateNodeComponentFromGenericType>(); } if (typeof(T).IsEnum){ return NodeEditorExtensions.CreateNodeComponentFromGenericType(typeof(InspectorItem)) as InspectorItem; } return null; } public INodeDataBindingBase Create(Type t){ var genericType = typeof(InspectorItem<>).MakeGenericType(t); var hasSpecificType = NodeEditorExtensions.HasSpecificTypeComponent(genericType); if (hasSpecificType){ return NodeEditorExtensions.CreateNodeComponentFromGenericType(genericType) as INodeDataBindingBase; } if (t.IsEnum){ return NodeEditorExtensions.CreateNodeComponentFromGenericType(typeof(InspectorItem)) as INodeDataBindingBase; } return null; } } }