From 4573ff4c6e46983935c891615cfcdb1b4e8b4063 Mon Sep 17 00:00:00 2001 From: "CodeSmile-PC\\CodeSmile" <42713966+CodeSmile-0000011110110111@users.noreply.github.com> Date: Tue, 30 Jan 2024 18:06:03 +0100 Subject: [PATCH] added new Asset Workflow demo with GUI and switch between CodeSmile and Unity API --- CHANGELOG.md | 5 + ...dow.cs => AssetDemoWindow.CodeSmileAPI.cs} | 106 +++------ .../AssetDemoWindow.CodeSmileAPI.cs.meta | 3 + .../AssetDemoWindow.UnityAPI.cs | 212 ++++++++++++++++++ .../AssetDemoWindow.UnityAPI.cs.meta | 3 + .../AssetWorkflowWithGUI/AssetDemoWindow.cs | 108 +++++++++ ...Window.cs.meta => AssetDemoWindow.cs.meta} | 0 ...seDemoWindow.uxml => AssetDemoWindow.uxml} | 1 + ...ow.uxml.meta => AssetDemoWindow.uxml.meta} | 0 ...CodeSmileEditor.AssetDatabase.Demo.asmdef} | 4 +- ...mileEditor.AssetDatabase.Demo.asmdef.meta} | 0 package.json | 2 +- 12 files changed, 365 insertions(+), 79 deletions(-) rename Samples~/AssetWorkflowWithGUI/{CodeSmileAssetDatabaseDemoWindow.cs => AssetDemoWindow.CodeSmileAPI.cs} (56%) create mode 100644 Samples~/AssetWorkflowWithGUI/AssetDemoWindow.CodeSmileAPI.cs.meta create mode 100644 Samples~/AssetWorkflowWithGUI/AssetDemoWindow.UnityAPI.cs create mode 100644 Samples~/AssetWorkflowWithGUI/AssetDemoWindow.UnityAPI.cs.meta create mode 100644 Samples~/AssetWorkflowWithGUI/AssetDemoWindow.cs rename Samples~/AssetWorkflowWithGUI/{CodeSmileAssetDatabaseDemoWindow.cs.meta => AssetDemoWindow.cs.meta} (100%) rename Samples~/AssetWorkflowWithGUI/{CodeSmileAssetDatabaseDemoWindow.uxml => AssetDemoWindow.uxml} (85%) rename Samples~/AssetWorkflowWithGUI/{CodeSmileAssetDatabaseDemoWindow.uxml.meta => AssetDemoWindow.uxml.meta} (100%) rename Samples~/AssetWorkflowWithGUI/{CodeSmileEditor.AssetDatabase.Sample.asmdef => CodeSmileEditor.AssetDatabase.Demo.asmdef} (88%) rename Samples~/AssetWorkflowWithGUI/{CodeSmileEditor.AssetDatabase.Sample.asmdef.meta => CodeSmileEditor.AssetDatabase.Demo.asmdef.meta} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 37efedb..ac10751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,15 @@ # Change Log +#### v1.8.6 - Jan 30, 2024 + +- added Sample: Asset Workflow with GUI. Allows selecting between CodeSmile and Unity API. Unity API code is 33% more lines/characters, with folder creation hardcoded. + #### v1.8.5 - Jan 29, 2024 - added Asset.File.FindPaths overload accepting Path[] - added Asset.Label.GetAll overload accepting Path - added Asset.Label.Remove and Asset().RemoveLabel +- fixed invalid cast exception (Asset.Path[] to string[]) - removed add sub-asset check for ".asset" extension. Turns out you can also add subassets to a .mesh extension asset and there may be others. #### v1.8.4 - Jan 24, 2024 diff --git a/Samples~/AssetWorkflowWithGUI/CodeSmileAssetDatabaseDemoWindow.cs b/Samples~/AssetWorkflowWithGUI/AssetDemoWindow.CodeSmileAPI.cs similarity index 56% rename from Samples~/AssetWorkflowWithGUI/CodeSmileAssetDatabaseDemoWindow.cs rename to Samples~/AssetWorkflowWithGUI/AssetDemoWindow.CodeSmileAPI.cs index 548e427..61a62db 100644 --- a/Samples~/AssetWorkflowWithGUI/CodeSmileAssetDatabaseDemoWindow.cs +++ b/Samples~/AssetWorkflowWithGUI/AssetDemoWindow.CodeSmileAPI.cs @@ -1,69 +1,20 @@ -// Copyright (C) 2021-2024 Steffen Itterheim +// Copyright (C) 2021-2024 Steffen Itterheim // Refer to included LICENSE file for terms and conditions. using CodeSmile_AssetDatabase_Demo; using CodeSmileEditor; -using System; using System.Collections.Generic; -using UnityEditor; using UnityEngine; -using UnityEngine.UIElements; -public class CodeSmileAssetDatabaseDemoWindow : EditorWindow +public partial class AssetDemoWindow { - private static readonly Asset.Path DemoAssetsPath = "Assets/CodeSmile AssetDatabase Demo Assets/Sample Assets"; - - [SerializeField] private VisualTreeAsset m_VisualTreeAsset; - - [MenuItem("Window/CodeSmile/AssetDatabase Examples/Workflow Demo", priority = 2999)] - public static void ShowAssetDatabaseDemoWindow() - { - var wnd = GetWindow(); - wnd.titleContent = new GUIContent("CodeSmile AssetDatabase Demo"); - } - - public void CreateGUI() - { - var uiBuilderDocument = m_VisualTreeAsset.Instantiate(); - rootVisualElement.Add(uiBuilderDocument); - - RegisterCallbacks(true); - } - - private void OnDestroy() => RegisterCallbacks(false); - - private void RegisterCallbacks(Boolean register) - { - var createButton = rootVisualElement.Q