Quantcast
Channel: UGUI & TextMesh Pro
Viewing all articles
Browse latest Browse all 23263

Change Button spriteState iOS exception \ bug

$
0
0
Hello!

I found a bug in unity which appears when you try to change Button's spriteState and set pressedSprite field programmatically.

The code below:

Code (CSharp):
  1.  
  2.  
  3.     public Button btn;
  4.     public Sprite imgPress;
  5.  
  6.     // Use this for initialization
  7.     void Start () {
  8.         SpriteState ss = btn.spriteState;
  9.         ss.pressedSprite = imgPress;
  10.         btn.spriteState = ss;
  11.     }
  12.  
  13.  
causes an exception TypeInitializationException with 100%...

Change Button spriteState iOS exception \ bug

Viewing all articles
Browse latest Browse all 23263

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>