Hello,
I'm trying to change a UIAtlas reference at runtime after loading a bundle
This is our situation.
We have 2 bundles for each platform
bundle_HD_ios.unity3d
bundle_SD_ios.unity3d
bundle_HD_android.unity3d
bundle_SD_android.unity3d
We have a loadingScene that loads the correct bundle from www (or local) (ios or android version) with the correct atlas for the platform used.
At this point, we have all of our scenes pointing to a UIAtlas Reference (for example SD version atlas or dummy atlas), and we want to change the Reference of this atlas after loading the atlas from the bundle.
This is the code we have, but doesn't work only works if we use the atlas (with prefab) in the loading scene and we make a sprite using this atlas.
Any idea/help will be very appreciated.
...
//The download is done, instantiate the asset from the bundle
GameObject obj = asset.InstantiateAsset();
gui_pack_001_link = GameObject.FindWithTag("gui_pack_001_link").GetComponent<UIAtlas>();
//gui_pack_001_link = GameObject.Find ("gui_pack_001_link").GetComponent<UIAtlas>();
gui_pack_001_link.replacement = obj.GetComponent<UIAtlas>();
//Remove the asset from the loading list
...