XimmerseXRMetadata.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //-----------------------------------------------------------------------
  2. // <copyright file="CardboardMetadata.cs" company="Google LLC">
  3. // Copyright 2020 Google LLC
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License");
  6. // you may not use this file except in compliance with the License.
  7. // You may obtain a copy of the License at
  8. //
  9. // http://www.apache.org/licenses/LICENSE-2.0
  10. //
  11. // Unless required by applicable law or agreed to in writing, software
  12. // distributed under the License is distributed on an "AS IS" BASIS,
  13. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. // See the License for the specific language governing permissions and
  15. // limitations under the License.
  16. // </copyright>
  17. //-----------------------------------------------------------------------
  18. #if XR_MGMT_GTE_320
  19. namespace Ximmerse.XR
  20. {
  21. using System.Collections.Generic;
  22. using UnityEditor;
  23. using UnityEditor.XR.Management.Metadata;
  24. using UnityEngine;
  25. /// <summary>
  26. /// XR Metadata for Cardboard XR Plugin.
  27. /// Required by XR Management package.
  28. /// </summary>
  29. public class XimmerseXRPackage : IXRPackage
  30. {
  31. /// <summary>
  32. /// Package metadata instance.
  33. /// </summary>
  34. public IXRPackageMetadata metadata => new PackageMetadata();
  35. /// <summary>
  36. /// Populates package settings instance.
  37. /// </summary>
  38. ///
  39. /// <param name="obj">
  40. /// Settings object.
  41. /// </param>
  42. /// <returns>Settings analysis result. Given that nothing is done, returns true.</returns>
  43. public bool PopulateNewSettingsInstance(ScriptableObject obj)
  44. {
  45. return true;
  46. }
  47. private class LoaderMetadata : IXRLoaderMetadata
  48. {
  49. public string loaderName => "Ximmerse XR Plugin";
  50. public string loaderType => typeof(Ximmerse.XR.XimmerseXRLoader).FullName;
  51. public List<BuildTargetGroup> supportedBuildTargets => new List<BuildTargetGroup>()
  52. {
  53. BuildTargetGroup.Android,
  54. BuildTargetGroup.iOS
  55. };
  56. }
  57. private class PackageMetadata : IXRPackageMetadata
  58. {
  59. public string packageName => "Ximmerse XR Plugin";
  60. public string packageId => "com.ximmerse.xr";
  61. public string settingsType => typeof(Ximmerse.XR.XimmerseXRSettings).FullName;
  62. public List<IXRLoaderMetadata> loaderMetadata => new List<IXRLoaderMetadata>()
  63. {
  64. new LoaderMetadata()
  65. };
  66. }
  67. }
  68. }
  69. #endif // XR_MGMT_GTE_320