VoiceApplicationDetailProvider.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 UnityEditor;
  21. using System.Reflection;
  22. using Meta.WitAi.Windows;
  23. using Oculus.Voice.Inspectors;
  24. namespace Oculus.Voice.Windows
  25. {
  26. public class VoiceApplicationDetailProvider : WitApplicationPropertyDrawer
  27. {
  28. // Skip fields if voice sdk app id
  29. protected override bool ShouldLayoutField(SerializedProperty property, FieldInfo subfield)
  30. {
  31. string appID = GetFieldStringValue(property, "id").ToLower();
  32. if (AppVoiceExperienceWitConfigurationEditor.IsBuiltInConfiguration(appID))
  33. {
  34. switch (subfield.Name)
  35. {
  36. case "name":
  37. case "lang":
  38. return true;
  39. default:
  40. return false;
  41. }
  42. }
  43. return base.ShouldLayoutField(property, subfield);
  44. }
  45. }
  46. }