Building a standalone application with assetbundle

Hi, this is my first post to the forum. I’m working on a unity standalone desktop application, where I’ve hit a roadblock when using asset-bundles for this platform. My scenario is that, the application I develop is to be deployed as standalone application on user’s systems. The below steps would give a fair idea of the issue.

  • Development of the application.
  • Unity Asset-bundle of assets(models,textures, scenes etc) and publish to platform.
  • The app.exe and the supporting data files to be copied to a server.
  • Users download only the app.exe on the first run.
  • Opening the application will download the respective asset-bundle and the game executes.

This is NOT a one time development-publish-execute activity.

  • There will be patches created/assets added on a regular basis to new asset-bundles.
  • The application should check for the new AB, download them and integrate with the game.

Although these are vague steps and the only solution I found viable to my problem, I don’t have a faintest idea of how to go about it. So I’ve come here to ask for unity experts, to suggest me if this would work, and if possible a way to do this. Any help would be greatly appreciated.
Thanks.

I could’nt give you what i do in my compagny because i have a contract.

But we use this on Unity 4.x :
import System.IO;

//static var platforms = [BuildTarget.StandaloneWindows];
static var platforms = [BuildTarget.iOS];
//static var platforms = [BuildTarget.Android];

//static var extensions = ["win"];
static var extensions = ["ios"];
//static var extensions = ["android"];

@MenuItem("Assets/Build AssetBundle From Selection - Track dependencies (ios)")
static function ExportResource () 
{
	// Bring up save panel
	var path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
	if (path.Length != 0)
	{
		for (var i = 0; i < platforms.length; ++i)
		{  
			// Build the resource file from the active selection.
			var selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
			
			var filename = Path.GetFileNameWithoutExtension (path);
			
			var fileIndex = path.IndexOf  (filename);
			var platformPath = path.Substring (0, fileIndex) + filename + "_" + extensions  *+ ".unity3d";*
  •  	//Temporaire, plus rapide car on n'a que l'export ios a faire.*
    
  •  	//var platformPath = path.Substring (0, fileIndex) + filename + ".unity3d";*
    
  •  	BuildPipeline.BuildAssetBundle(Selection.activeObject,* 
    
  •  								   selection,* 
    
  •  								   platformPath,* 
    
  •  								   BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets,*
    

_ platforms );_

* Selection.objects = selection;*
* }*
* }*
}

@MenuItem(“Assets/Build AssetBundle From Selection - No dependency tracking”)
static function ExportResourceNoTrack ()
{
* // Bring up save panel*
* var path = EditorUtility.SaveFilePanel (“Save Resource”, “”, “New Resource”, “unity3d”);*
* if (path.Length != 0)*
* {*
* for (var i = 0; i < platforms.length; ++i)*
* {*
* // Build the resource file from the active selection.*
* var selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);*

* var filename = Path.GetFileNameWithoutExtension (path);*

* var fileIndex = path.IndexOf (filename);*
var platformPath = path.Substring (0, fileIndex) + filename + “_” + extensions + “.unity3d”;

* // Build the resource file from the active selection.*
* BuildPipeline.BuildAssetBundle(Selection.activeObject,*
* Selection.objects,*
* platformPath,*
* BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets,*
_ platforms );
* }
}
}
@MenuItem(“Assets/Auto Build Resource Files”)*

static function ExportResource () {_

* var options = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets;*
* BuildPipeline.PushAssetDependencies();*

* // All subsequent resources share assets in this resource file*
* // It is up to you to ensure that the shared resource file is loaded prior to loading other resources*
* BuildPipeline.BuildAssetBundle(AssetDatabase.LoadMainAssetAtPath(“Assets/artwork/lerpzuv.tif”), null, “Shared.unity3d”, options); *

* // By pushing and popping around the resource file, this file will share resources but later resource files will not share assets in this resource*
* BuildPipeline.PushAssetDependencies();*

* BuildPipeline.BuildAssetBundle(AssetDatabase.LoadMainAssetAtPath(“Assets/Artwork/Lerpz.fbx”), null, “Lerpz.unity3d”, options); *

* BuildPipeline.PopAssetDependencies();*

* // By pushing and popping around the resource file, this file will share resources but later resource files will not share assets in this resource*
* BuildPipeline.PushAssetDependencies();*

* BuildPipeline.BuildAssetBundle(AssetDatabase.LoadMainAssetAtPath(“Assets/Artwork/explosive guitex.prefab”), null, “explosive.unity3d”, options); *

* BuildPipeline.PopAssetDependencies();*

* // By pushing and popping around the resource file, this file will share resources but later resource files will not share assets in this resource*
* BuildPipeline.PushAssetDependencies();*

* // Build streamed scene file into a seperate unity3d file*
* BuildPipeline.BuildPlayer([“Assets/AdditiveScene.unity”], “AdditiveScene.unity3d”, BuildTarget.WebPlayer, BuildOptions.BuildAdditionalStreamedScenes); *
* if (System.IO.File.Exists(“AdditiveScene.html”))*
* System.IO.File.Delete(“AdditiveScene.html”); *

* BuildPipeline.PopAssetDependencies();*

* BuildPipeline.PopAssetDependencies();*

* BuildPipeline.BuildPlayer([“Assets/Loader.unity”], “loader.unity3d”, BuildTarget.WebPlayer, BuildOptions.Development);*
}
With these script you only have to comment or decommment the line a the top of document to bundle on ios or windows.
This is for creation of bundle.
After this for the reading we use AssetBundle.LoadAsset(string name).
I can’t say more, i apologize. But this idea is great and powerful. Difficult to start with.
I give you some source to learn : Unite 2014 - New AssetBundle Build System in Unity 5 - YouTube for Unity 5.x
Unite 2012 - Asset Bundles : Creative Uses and Best Practices - YouTube for unity 4.x
Unity Asset Bundles Tutorial - Setup and Use Example - YouTube for unity 4.x