VungleBuildHelper.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using UnityEditor;
  3. using UnityEngine;
  4. class VungleBuildHelper
  5. {
  6. #if UNITY_5
  7. [UnityEditor.MenuItem("Tools/Vungle/Prepare Windows 10 Build")]
  8. static void prepareWin10()
  9. {
  10. PluginImporter pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDKProxy.winmd");
  11. pi.SetPlatformData(BuildTarget.WSAPlayer, "PlaceholderPath", "Assets/Plugins/VungleSDKProxy.dll");
  12. pi.SaveAndReimport();
  13. pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDK.winmd");
  14. pi.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "SDK81");
  15. pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/UWP/VungleSDK.winmd");
  16. pi.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, true);
  17. pi.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "UWP");
  18. pi.SaveAndReimport();
  19. }
  20. [UnityEditor.MenuItem("Tools/Vungle/Prepare Windows 8.1 Build")]
  21. static void prepareWin81()
  22. {
  23. PluginImporter pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDKProxy.winmd");
  24. pi.SetPlatformData(BuildTarget.WSAPlayer, "PlaceholderPath", "Assets/Plugins/VungleSDKProxy.dll");
  25. pi.SaveAndReimport();
  26. pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/VungleSDK.winmd");
  27. pi.SetPlatformData(BuildTarget.WSAPlayer, "SDK", "SDK81");
  28. pi.SaveAndReimport();
  29. pi = (PluginImporter)PluginImporter.GetAtPath("Assets/Plugins/Metro/UWP/VungleSDK.winmd");
  30. pi.SetCompatibleWithPlatform(BuildTarget.WSAPlayer, false);
  31. pi.SaveAndReimport();
  32. }
  33. #endif
  34. }