19 lines
771 B
C#
19 lines
771 B
C#
using System;
|
|
using System.IO;
|
|
using AIGame.EditorTools;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
public static class BuildInventory
|
|
{
|
|
public static string Build()
|
|
{
|
|
if(EditorApplication.isPlaying)throw new Exception("Build inventory in Edit Mode");
|
|
string repo=Directory.GetParent(Application.dataPath).Parent.FullName;
|
|
foreach(string name in new[]{"Bag","Shop"})
|
|
if(string.IsNullOrEmpty(JsonUIPrefabBuilder.BuildFromJsonFile(Path.Combine(repo,"Doc/UIPrefabCreater/UI_Prototype"+name+".json"))))throw new Exception("Build inventory failed");
|
|
SetupUiBundleCollector.Setup();AssetDatabase.SaveAssets();
|
|
return "Built Candy bag and supply shop from JSON, reusing existing portraits/icons and nine-slices.";
|
|
}
|
|
}
|