From 73bbba9de5210ae7f895ae82bd2524eb76e3a38c Mon Sep 17 00:00:00 2001 From: yum Date: Fri, 30 Sep 2022 13:13:57 -0700 Subject: begin unity-native port --- TaSTT.cs | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 TaSTT.cs (limited to 'TaSTT.cs') diff --git a/TaSTT.cs b/TaSTT.cs new file mode 100644 index 0000000..d9901d6 --- /dev/null +++ b/TaSTT.cs @@ -0,0 +1,78 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEditor.Animations; +using UnityEngine; +using VRC.SDK3.Avatars.Components; +using VRC.SDK3.Avatars.ScriptableObjects; + +namespace TaSTT +{ + public class TaSTT : EditorWindow + { + private static TaSTT instance_; + private GameObject avatar_root_; + private AnimatorController fx_controller_; + + [MenuItem("Window/TaSTT")] + private static void ShowWindow() + { + instance_ = GetWindow(); + instance_.titleContent = new GUIContent("TaSTT"); + } + + private void Draw() + { + GUILayout.Label("TaSTT: A free VRChat STT"); + GUILayout.Label("Made with love by yum_food"); + GUILayout.Label(""); + + avatar_root_ = (GameObject)EditorGUILayout.ObjectField( + new GUIContent("Avatar Root"), avatar_root_, + typeof(GameObject), true); + fx_controller_ = (AnimatorController)EditorGUILayout.ObjectField( + new GUIContent("FX Controller"), fx_controller_, + typeof(AnimatorController), true); + + if (GUILayout.Button("Create animations!")) + { + if (avatar_root_ == null || !fx_controller_ == null) + { + // TODO(yum_food) why doesn't EditorGUILayout.HelpBox() work here? + Debug.LogError("Avatar root or FX controller are not set! Cannot create animations."); + return; + } + // TODO(yum_food) + } + if (GUILayout.Button("Create FX layer!")) + { + if (!avatar_root_ == null || !fx_controller_ == null) + { + Debug.LogError("Avatar root or FX controller are not set! Cannot create FX layer."); + return; + } + // TODO(yum_food) + } + } + + private static void CreateAnimations() + { + VRCAvatarDescriptor descriptor = avatar_root_.GetComponent(); + if (descriptor == null) + { + Debug.LogError("Failed to get avatar descriptor"); + return; + } + AnimationClip anim = new AnimationClip(); + clip.frameRate = 1f; + } + + private void OnGUI() + { + if (instance_ != null) + { + Draw(); + } + } + } +} -- cgit v1.2.3