AntiAddictionExporter.cs 732 B

123456789101112131415161718192021
  1. using System.Diagnostics;
  2. using System.IO;
  3. using UnityEngine;
  4. using UnityEditor;
  5. using Debug = UnityEngine.Debug;
  6. namespace TapTap.AntiAddiction.Editor {
  7. public class AntiAddictionExporter {
  8. [MenuItem("TapTap/Export PC Anti-Addiction SDK")]
  9. static void Export() {
  10. string path = EditorUtility.OpenFolderPanel("Export path", "", "");
  11. string[] assetPaths = new string[] {
  12. "Assets/TapTap/AntiAddiction"
  13. };
  14. string exportPath = Path.Combine(path, "pc-anti-addiction.unitypackage");
  15. AssetDatabase.ExportPackage(assetPaths, exportPath,
  16. ExportPackageOptions.Recurse);
  17. Debug.Log("Export done.");
  18. }
  19. }
  20. }