MetaHubContext.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 System;
  9. using System.Drawing;
  10. using UnityEngine;
  11. namespace Meta.Voice.Hub
  12. {
  13. public class MetaHubContext : ScriptableObject
  14. {
  15. [Header("Context Configuration")]
  16. [Tooltip("The title of the window if this is the primary context")]
  17. [SerializeField] private string _windowTitle;
  18. [Tooltip("The logo to use if this is the primary context")]
  19. [SerializeField] private Texture2D _logo;
  20. [Tooltip("The icon to use if this is the primary context")]
  21. [SerializeField] private Texture2D _icon;
  22. [Tooltip("The priority of this context. Lower number means higher probability that this will be the primary context.")]
  23. [SerializeField] private int _priority = 1000;
  24. [Tooltip("If there are no context filters you will have")]
  25. [SerializeField] private bool _allowWithoutContextFilter = true;
  26. [Header("Page Content")]
  27. [SerializeField] private bool showPageGroupTitle = true;
  28. [SerializeField] private MetaHubPage[] _pages;
  29. [SerializeField] private ScriptableObjectReflectionPage[] _scriptableObjectPages;
  30. [SerializeField] private string _defaultPage;
  31. public virtual string Name => name;
  32. public virtual int Priority => _priority;
  33. public virtual Texture2D LogoImage => _logo;
  34. public virtual Texture2D Icon => _icon;
  35. public virtual string DefaultPage => _defaultPage;
  36. public virtual string Title => _windowTitle;
  37. public virtual bool ShowPageGroupTitle => showPageGroupTitle;
  38. public virtual bool AllowWithoutContextFilter => _allowWithoutContextFilter;
  39. public virtual ScriptableObjectReflectionPage[] ScriptableObjectReflectionPages => _scriptableObjectPages;
  40. [Serializable]
  41. public class ScriptableObjectReflectionPage
  42. {
  43. [SerializeField] public string scriptableObjectType;
  44. [SerializeField] public string namePrefix;
  45. [Tooltip("A modifier the priority of all pages of this type.")]
  46. [SerializeField] public int priorityModifier;
  47. }
  48. }
  49. }