- Home /
Asset Bundle export script 'Cannot convert' error
Hiya! I'll start by saying that I have nearly no C# experience/knowledge at all, and am learning as I go. I'm attempting to modify the asset bundle export script provided in the Unity 5 documentation to suit my needs, and have run into a pair of errors that I can't find a solution for: Error CS1503: Argument '3': cannot convert from 'UnityEditor.BuildAssetBundleOptions' to 'UnityEditor.BuildTarget'
Error CS1502: The best overloaded method match for 'UnityEditor.BuildPipeline.BuildAssetBundles(string, UnityEditor.AssetBundleBuild[], UnityEditor.BuildAssetBundleOptions, UnityEditor.BuildTarget)' has some invalid arguments
The script is as follows
using UnityEditor;
public class CreateAssetBundles
{
[MenuItem ("Assets/Build AssetBundles")]
static void BuildAllAssetBundles ()
{
BuildPipeline.BuildAssetBundles ("AssetBundles" , BuildAssetBundleOptions.DisableWriteTypeTree, BuildAssetBundleOptions.UncompressedAssetBundle, BuildTarget.StandaloneWindows);
}
}
From what I've gathered, the error results from having both the BuildAssetBundleOptions.DisableWriteTypeTree and BuildAssetBundleOptions.UncompressedAssetBundle variables in at the same time.
Any help is appreciated.
Answer by Lunarpolitiks · Mar 16, 2015 at 06:36 AM
Well, I've solved the problem myself :)
On line 8 I needed to add a | in the middle of BuildAssetBundleOptions.DisableWriteTypeTree, BuildAssetBundleOptions.UncompressedAssetBundle
I was trying to make a Unity 5 asset bundle work in a Unity 4 game, but it appears they are incompatible.
Your answer
Follow this Question
Related Questions
error with GUI in c sharp 2 Answers
Distribute terrain in zones 3 Answers
char and char* 2 Answers
error CS1502 and error CS1503 What is this? 1 Answer
Targetting script errors 1 Answer