So, I have this array of Tex2Ds, and I am iterating over them in a script. I’m using a nice simple…
if (counter >= EndFrame) counter = 0;
RenderPlane.renderer.material.mainTexture = sortedImages[counter];
counter++;
}
… method sat in a coroutine. It works beautifully in editor and when included in a build, but not so well in an assetBundle. It simply wont iterate through those textures, almost as if it isn’t including them.
Our assetBundle exporter has “BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets);” to include dependencies, but I must be missing one more golden step?
(Note: The eagle eyed amongst you may have noticed my frames aren’t in order, these get sorted at runtime).
Edit: It appears that the assetBundle IS including all textures, there is an issue with my code not iterating.
private IEnumerator ImageSequencerCoroutine() {
while (true) {
yield return incrementInterval; // type WaitForSeconds
if (counter >= EndFrame) counter = 0;
RenderPlane.renderer.material.mainTexture = sortedImages[counter];
counter++;
}
//Assign frame
}