public static void ExportCurrentUI() { if (EditorApplication.isPlaying) { Log.Error("Cannot export in playing mode! Please stop!"); return; } #if UNITY_4 var windowAssets = GetUIWIndoeAssetsFromCurrentScene(); foreach (var windowAsset in windowAssets) { BuildTools.BuildAssetBundle(windowAsset.gameObject, GetBuildRelPath(windowAsset.name)); } #else UISceneToPrefabs(); #endif }
public static uint BuildScriptableObject <T> (T scriptObject, string path, BuildTarget buildTarget, KResourceQuality quality) where T : ScriptableObject { const string tempAssetPath = "Assets/~Temp.asset"; AssetDatabase.CreateAsset(scriptObject, tempAssetPath); T tempObj = (T)AssetDatabase.LoadAssetAtPath(tempAssetPath, typeof(T)); if (tempObj == null) { throw new System.Exception(); } uint crc = BuildTools.BuildAssetBundle(tempObj, path, buildTarget, quality); AssetDatabase.DeleteAsset(tempAssetPath); return(crc); }