From 3f5fd7aff7474e3afe0106ebb63c085cb3a4d340 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=C3=AF=7E?= Date: Sun, 3 Sep 2023 16:23:16 +0200 Subject: [PATCH] (MIGRATION END) Change namespaces --- Examples/GenExample3_Gesturing.cs | 2 +- .../GenExample4_NonDestructiveWorkflow.cs | 55 +++++++++++++++++++ ...GenExample4_NonDestructiveWorkflow.cs.meta | 3 + Framework/Editor/V1VRC/TrackingElement.cs | 2 +- Framework/Editor/V1VRC/VRChatExtensions.cs | 3 +- .../AIACVRCExtensionsDriverGenerationTest.cs | 2 +- .../AIACVRCExtensionsMiscGenerationTest.cs | 2 +- 7 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 Examples/GenExample4_NonDestructiveWorkflow.cs create mode 100644 Examples/GenExample4_NonDestructiveWorkflow.cs.meta diff --git a/Examples/GenExample3_Gesturing.cs b/Examples/GenExample3_Gesturing.cs index c7ccddd..c78be8c 100644 --- a/Examples/GenExample3_Gesturing.cs +++ b/Examples/GenExample3_Gesturing.cs @@ -6,7 +6,7 @@ using VRC.SDK3.Avatars.Components; using UnityEditor; using UnityEditor.Animations; using AnimatorAsCode.V1.VRCDestructiveWorkflow; -using AnimatorAsCode.V1VRC; +using AnimatorAsCode.V1.VRC; namespace AnimatorAsCodeFramework.Examples { diff --git a/Examples/GenExample4_NonDestructiveWorkflow.cs b/Examples/GenExample4_NonDestructiveWorkflow.cs new file mode 100644 index 0000000..1f90458 --- /dev/null +++ b/Examples/GenExample4_NonDestructiveWorkflow.cs @@ -0,0 +1,55 @@ +#if UNITY_EDITOR +using AnimatorAsCode.V1; +using UnityEngine; +using VRC.SDK3.Avatars.Components; +using UnityEditor; +using UnityEditor.Animations; + +namespace AnimatorAsCodeFramework.Examples +{ + public class GenExample4_NonDestructiveWorkflow : MonoBehaviour + { + public VRCAvatarDescriptor avatar; + public AnimatorController assetContainer; + public string assetKey; + public SkinnedMeshRenderer iconMesh; + } + + [CustomEditor(typeof(GenExample4_NonDestructiveWorkflow), true)] + public class GenExample4_NonDestructiveWorkflowEditor : Editor + { + private const string SystemName = "Example 3"; + + private GenExample4_NonDestructiveWorkflow my; + private AacFlBase aac; + + public override void OnInspectorGUI() + { + AacExample.InspectorTemplate(this, serializedObject, "assetKey", Create, Remove); + } + + private void Create() + { + my = (GenExample4_NonDestructiveWorkflow) target; + aac = AacExample.AnimatorAsCode(SystemName, my.avatar, my.assetContainer, my.assetKey); + + CreateMainLayer(); + } + + private void Remove() + { + // AacExample.AnimatorAsCode invokes ClearPreviousAssets. + // This will cause the generated controller to be removed. + AacExample.AnimatorAsCode(SystemName, my.avatar, my.assetContainer, my.assetKey); + } + + private void CreateMainLayer() + { + // TODO + // var fx = aac.NewAnimatorController(); + // var layer = fx.CreateLayer(); + // ... + } + } +} +#endif \ No newline at end of file diff --git a/Examples/GenExample4_NonDestructiveWorkflow.cs.meta b/Examples/GenExample4_NonDestructiveWorkflow.cs.meta new file mode 100644 index 0000000..cac3b5f --- /dev/null +++ b/Examples/GenExample4_NonDestructiveWorkflow.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: e6458c1a918843d6b2a91932ddf9d0a5 +timeCreated: 1693750693 \ No newline at end of file diff --git a/Framework/Editor/V1VRC/TrackingElement.cs b/Framework/Editor/V1VRC/TrackingElement.cs index 7a490a8..5b2dcdf 100644 --- a/Framework/Editor/V1VRC/TrackingElement.cs +++ b/Framework/Editor/V1VRC/TrackingElement.cs @@ -1,5 +1,5 @@ // ReSharper disable once CheckNamespace -namespace AnimatorAsCode.V1VRC +namespace AnimatorAsCode.V1.VRC { public enum TrackingElement { diff --git a/Framework/Editor/V1VRC/VRChatExtensions.cs b/Framework/Editor/V1VRC/VRChatExtensions.cs index d5df930..63c9786 100644 --- a/Framework/Editor/V1VRC/VRChatExtensions.cs +++ b/Framework/Editor/V1VRC/VRChatExtensions.cs @@ -1,10 +1,9 @@ using System; -using AnimatorAsCode.V1; using VRC.SDK3.Avatars.Components; using VRC.SDKBase; // ReSharper disable once CheckNamespace -namespace AnimatorAsCode.V1VRC +namespace AnimatorAsCode.V1.VRC { public static class VRChatExtensions { diff --git a/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsDriverGenerationTest.cs b/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsDriverGenerationTest.cs index c63500d..9bf5bf1 100644 --- a/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsDriverGenerationTest.cs +++ b/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsDriverGenerationTest.cs @@ -1,4 +1,4 @@ -using AnimatorAsCode.V1VRC; +using AnimatorAsCode.V1.VRC; using NUnit.Framework; using VRC.SDK3.Avatars.Components; using VRC.SDKBase; diff --git a/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsMiscGenerationTest.cs b/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsMiscGenerationTest.cs index c2b8895..1b3e9e7 100644 --- a/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsMiscGenerationTest.cs +++ b/Tests/V1VRC/PlayMode/GenerationTests/AIACVRCExtensionsMiscGenerationTest.cs @@ -1,4 +1,4 @@ -using AnimatorAsCode.V1VRC; +using AnimatorAsCode.V1.VRC; using NUnit.Framework; using VRC.SDK3.Avatars.Components; using VRC.SDKBase;