- Home /
Uncompressed Asset Bundle Still Has UnityFS tag and Thus Can't be Loaded With AssetBundle.LoadFromFile()
Hey There
The Situation
Before going into detail on my question, let me explain the situation that it comes from. I am working on a mod for From the Depths, which includes the ability to add .dll's with your own scripts or replacing existing classes. Because it is a mod, it gives some limitations in how I can work with unity.
I am planning on creating a ParticleSystem, but due to the limitations, it either has to be created at run-time or I need to find some way to import it from outside the game. As the game is running on version 4.6.7f1, it is limited what can be modified in the ParticleSystem. This leads me to my current attempt at importing an Asset Bundle.
The Problem
Due to unity 4 not providing the option to create asset bundles (for free) I have used unity 5.3. With it I made an asset bundle including the material used for the particle systems and a prefab of the parent to the particle systems. I am aware that the version difference could cause a problem, but for now I have not gotten far enough for that to be an issue.
Below is the scrip used to build the asset bundle, The prefab and material are both "tagged" as futuretech and unity3d as extension in the editor.
using UnityEngine;
using UnityEditor;
public class CreateAssetBundles
{
[MenuItem ("Assets/Build AssetBundles")]
static void BuildAssetBundles()
{
BuildPipeline.BuildAssetBundles("Assets/AssetBundles",
BuildAssetBundleOptions.UncompressedAssetBundle |
BuildAssetBundleOptions.ForceRebuildAssetBundle,
BuildTarget.StandaloneWindows);
}
}
When trying to load the futuretech.unity3d at run-time in the game, I get this error message:
This asset bundle 'path' was not created with UncompressedAssetBundle flag, expected id 'UnityRaw', got 'UnityFS'
(It doesn't actually say path, I just removed the file path to make the message shorter)
I am using the static method AssetBundle.CreateFromFile() as WWW.assetBundle kept returning null. I used new Uri(path).AbsoluteUri for the WWW Url.
Alternatively, if it is not possible to fix this due to version differences, does anyone know if there is a way to create the particle system at run time? How it works:
Have 3 particle systems each spawning a single particle.
None of them have any speed.
2 of them changes, from 0 to full size over the lifetime, 3rd has 4 keys in the curve.
The color of all of them changes over time and changes between 6-8 different alpha levels at separate points.
The max size (renderer) is increased for all of them.
One of them uses horizontal billboard.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Export list of prefab to asset bundles recursively 0 Answers
Missing textures & materials in asset bundle 1 Answer
OnGui elements as objects? 2 Answers