Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jandujar

Pages: [1]
1
finally I found the solution.

  1.  
  2. //The download is done, instantiate the asset from the bundle
  3.                                         GameObject obj = asset.InstantiateAsset();
  4.                                         gui_pack_001_link = Resources.Load("AtlasReferences/" + "gui_pack_001_link" , typeof(UIAtlas)) as UIAtlas;
  5.                                         gui_pack_001_link.replacement = obj.GetComponent<UIAtlas>();
  6.                                         DontDestroyOnLoad(obj);

2
Can you post any example of usage?

I don't know how to implement this.

Does it works with asset bundles?

3
Do we need to create a instance atlas like this?

  1.     #region Singleton
  2.     private static AssetBundleManager instance = null;
  3.     public static AssetBundleManager Instance
  4.     {
  5.         get
  6.         {
  7.             if (instance == null) // if the static instance is null, then create an instance of the manager
  8.             {
  9.                 Debug.Log("Creating an AssetBundle manager instance");
  10.                 GameObject go = new GameObject();
  11.                 instance = go.AddComponent<AssetBundleManager>();
  12.                 go.name = "AssetBundleManager";
  13.                                
  14.                 DontDestroyOnLoad(go);
  15.             }
  16.  
  17.             return instance;
  18.         }
  19.     }
  20.     #endregion
  21.  

4
NGUI 3 Support / Re: NGUI + Texturepacker help
« on: May 27, 2014, 10:34:06 AM »
thanks for your hep. ;)

5
NGUI 3 Support / Change UIAtlas References from downloaded bundle
« on: May 27, 2014, 10:32:27 AM »
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.

  1. ...
  2.                                         //The download is done, instantiate the asset from the bundle
  3.                                         GameObject obj = asset.InstantiateAsset();
  4.                                         gui_pack_001_link = GameObject.FindWithTag("gui_pack_001_link").GetComponent<UIAtlas>();
  5.                                         //gui_pack_001_link = GameObject.Find ("gui_pack_001_link").GetComponent<UIAtlas>();
  6.                                         gui_pack_001_link.replacement = obj.GetComponent<UIAtlas>();
  7.                                         //Remove the asset from the loading list
  8. ...
  9.  


6
NGUI 3 Support / NGUI + Texturepacker help
« on: May 12, 2014, 05:12:44 AM »
Hello,

we are trying to use "texturepacker" with NGUI with no success.

We need something to translate from texturepacker data to NGUI atlas information

Any advice of how to get this working?

We know that we can use atlas maker (from NGUI) to make atlas for our game, but we need to use texturepacker because we use advanced features and scripting for generating our bundles.


Pages: [1]