using System; using System.IO; using AIGame.EditorTools; using UnityEditor; public static class BuildChallenge { public static string Build() { if (EditorApplication.isPlaying) throw new Exception("Build the challenge page in Edit Mode"); string repo = Directory.GetParent(UnityEngine.Application.dataPath).Parent.FullName; if (string.IsNullOrEmpty(JsonUIPrefabBuilder.BuildFromJsonFile(Path.Combine(repo, "Doc/UIPrefabCreater/UI_PrototypeChallenges.json")))) throw new Exception("Challenge prefab failed"); SetupUiBundleCollector.Setup(); AssetDatabase.SaveAssets(); return "Built the element challenge page"; } }