VoiceSDKHub.cs 972 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) Meta Platforms, Inc. and affiliates.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the license found in the
  6. * LICENSE file in the root directory of this source tree.
  7. */
  8. using Meta.Voice.Hub;
  9. using Meta.Voice.Hub.Attributes;
  10. using UnityEditor;
  11. namespace Meta.Voice.VSDKHub
  12. {
  13. [MetaHubContext(VoiceHubConstants.CONTEXT_VOICE)]
  14. public class VoiceSDKHub : MetaHubContext
  15. {
  16. [MenuItem("Oculus/Voice SDK/Voice Hub", false, 1)]
  17. private static void ShowWindow()
  18. {
  19. MetaHub.ShowWindow<MetaHub>(VoiceHubConstants.CONTEXT_VOICE);
  20. }
  21. public static void ShowPage(string page)
  22. {
  23. var window = MetaHub.ShowWindow<MetaHub>(VoiceHubConstants.CONTEXT_VOICE);
  24. window.SelectedPage = page;
  25. }
  26. public static string GetPageId(string pageName)
  27. {
  28. return VoiceHubConstants.CONTEXT_VOICE + "::" + pageName;
  29. }
  30. }
  31. }