BuildAssetPackages.cs 958 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using UnityEngine;
  2. using UnityEditor;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. using System.Linq;
  7. public class BuildAssetPackages
  8. {
  9. enum BuildConfiguration
  10. {
  11. Windows,
  12. Android
  13. }
  14. public static void Build()
  15. {
  16. Debug.Log("Building Deliverables");
  17. ExportPackages();
  18. }
  19. public static void ExportPackages()
  20. {
  21. string[] assets = AssetDatabase.FindAssets("t:Object", null).Select(s=>AssetDatabase.GUIDToAssetPath(s)).ToArray();
  22. assets = assets.Where(s=>
  23. s.StartsWith("Assets/Oculus/Avatar/") ||
  24. s.StartsWith("Assets/Oculus/AudioManager/") ||
  25. s.StartsWith("Assets/Oculus/LipSync/") ||
  26. s.StartsWith("Assets/Oculus/Platform/") ||
  27. s.StartsWith("Assets/Oculus/Spatializer/") ||
  28. s.StartsWith("Assets/Oculus/VoiceMod/") ||
  29. s.StartsWith("Assets/Oculus/VR/") ||
  30. s.StartsWith("Assets/Oculus/SampleFramework/")
  31. ).ToArray();
  32. AssetDatabase.ExportPackage(assets, "OculusIntegration.unitypackage");
  33. }
  34. }