If I create them this way, the bundle files are created without any file extension which leads to the issue that no asset is reckognized. As soon as I add the .unity3d extension manually and load the asset bundle, everything is fine. No I have no idea whats going wrong and I have also no interests in fixing the bundles everytime I create them.
I made an editor script. I would prefer to put this in the same script as the build stuff but I don’t know how to check if the bundle building process has completed. Put this in a new editor script and name it ash_RenameAssetBundles.cs then just call it after your finished building;
using UnityEditor;
using System.IO;
using UnityEngine;
public class ash_RenameAssetBundles
{
[MenuItem("Assets/Rename AssetBundles")]
static void RenameAssetBundles()
{
string[] files = Directory.GetFiles("AssetBundles");
foreach (var a in files)
{
if (!a.Contains("."))
{
File.Move(a, a + ".unity3d");
}
}
}
}
Just a reminder, we don’t have an
official file extension “.unity3d” for
asset bundle, it’s not mandatory. You
can use whatever file extension as you
want, or without file extension.
But usually people use “.unity3d” as
the file extension just because we
used it in the official sample code at
first time…