Last active
August 31, 2015 16:43
-
-
Save TomoakiNagahara/1671f2b7bdbcc772143c to your computer and use it in GitHub Desktop.
How to make AssetBundle ref: http://qiita.com/TomoakiNagahara/items/e48144b7778d9fb4213e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using System.Collections; | |
using System.IO; | |
public class ExportAssetBundles : MonoBehaviour | |
{ | |
[MenuItem("Assets/Unity 5.x Build AssetBundle")] | |
static void ExportResource_Unity5() | |
{ | |
Debug.Log("Target=" + EditorUserBuildSettings.activeBuildTarget.ToString()); | |
// Folder name is PlatForm name | |
string OutPutPath = Application.streamingAssetsPath + "/" + EditorUserBuildSettings.activeBuildTarget.ToString(); | |
if (Directory.Exists(OutPutPath) == false ) | |
{ | |
Directory.CreateDirectory(OutPutPath); | |
} | |
// Build AssetBundle at platform manifest. | |
BuildPipeline.BuildAssetBundles(OutPutPath, 0, EditorUserBuildSettings.activeBuildTarget); | |
Debug.Log("ComPress End"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment