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 - Xeno97

Pages: [1]
1
NGUI 3 Support / Re: UIAtlasMaker exception
« on: July 30, 2014, 03:34:29 PM »
I recently got the same error as the OP when trying to recreate a texture that was too large. After adding a null check above the error line in UIAtlasMaker (code below), it correctly stopped and showed an error telling me that the texture would be too big. Probably related to Unity trying to resize the texture for us, which means the texture we thought we had is no longer valid.

  1. ...
  2.  
  3. for (int i = 0; i < sprites.Count; ++i)
  4. {
  5.     Rect rect = NGUIMath.ConvertToPixels(rects[i], tex.width, tex.height, true);
  6.  
  7.     /******************* ADDED *******************/
  8.     // Check if the texture is gone before using it
  9.     if(textures[i] == null)
  10.     {
  11.         return false;
  12.     }
  13.     /***************** END ADDED! *****************/
  14.  
  15.     // Make sure that we don't shrink the textures
  16.     if (Mathf.RoundToInt(rect.width) != textures[i].width) return false;
  17.  
  18. ...
  19.  

Pages: [1]