VoiceSDKDataCreation.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * Licensed under the Oculus SDK License Agreement (the "License");
  6. * you may not use the Oculus SDK except in compliance with the License,
  7. * which is provided at the time of installation or download, or which
  8. * otherwise accompanies this software in either electronic or hard copy form.
  9. *
  10. * You may obtain a copy of the License at
  11. *
  12. * https://developer.oculus.com/licenses/oculussdk/
  13. *
  14. * Unless required by applicable law or agreed to in writing, the Oculus SDK
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. */
  20. using System;
  21. using Meta.WitAi;
  22. using Meta.WitAi.Configuration;
  23. using Meta.WitAi.Data;
  24. using Meta.WitAi.Data.Configuration;
  25. using Meta.WitAi.Windows;
  26. using UnityEditor;
  27. using UnityEngine;
  28. namespace Oculus.Voice.Data
  29. {
  30. [Serializable]
  31. public class VoiceSDKDataCreation
  32. {
  33. [MenuItem("Assets/Create/Voice SDK/Add App Voice Experience to Scene", false, 100)]
  34. public static void AddVoiceCommandServiceToScene()
  35. {
  36. var witGo = new GameObject();
  37. witGo.name = "App Voice Experience";
  38. var wit = witGo.AddComponent<AppVoiceExperience>();
  39. wit.RuntimeConfiguration = new WitRuntimeConfiguration
  40. {
  41. witConfiguration = WitDataCreation.FindDefaultWitConfig()
  42. };
  43. }
  44. [MenuItem("Assets/Create/Voice SDK/Values/String Value")]
  45. public static void WitStringValue()
  46. {
  47. WitDataCreation.CreateStringValue("");
  48. }
  49. [MenuItem("Assets/Create/Voice SDK/Values/Float Value")]
  50. public static void WitFloatValue()
  51. {
  52. WitDataCreation.CreateFloatValue("");
  53. }
  54. [MenuItem("Assets/Create/Voice SDK/Values/Int Value")]
  55. public static void WitIntValue()
  56. {
  57. WitDataCreation.CreateIntValue("");
  58. }
  59. [MenuItem("Assets/Create/Voice SDK/Configuration", false, 200)]
  60. public static void CreateWitConfiguration()
  61. {
  62. WitWindowUtility.OpenSetupWindow(null);
  63. }
  64. }
  65. }