Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Lotti on July 09, 2014, 11:42:21 AM

Title: WP8 UIButtonScale cause exception on OnHover
Post by: Lotti on July 09, 2014, 11:42:21 AM
latest unity (4.5.1) with latest ngui (3.6.7)

  1. System.Runtime.InteropServices.SEHException: External component has trown an exception.
  2. at UnityEngine.Internal.$Call.Invoke39(Int32 arg0, IntPtr method)
  3. at UnityEngine.Component.InternalGetGameObject()
  4. at UIButtonScale.OnHover(Boolean isOver)
  5.  

I think it is (as usual) a problem unity side. Do you think there is the possibility to fix this one?
Title: Re: WP8 UIButtonScale cause exception on OnHover
Post by: ArenMook on July 09, 2014, 03:39:34 PM
Do you have stripping turned on?

OnHover function is:
  1.         void OnHover (bool isOver)
  2.         {
  3.                 if (enabled)
  4.                 {
  5.                         if (!mStarted) Start();
  6.                         TweenScale.Begin(tweenTarget.gameObject, duration, isOver ? Vector3.Scale(mScale, hover) : mScale).method = UITweener.Method.EaseInOut;
  7.                 }
  8.         }
Since the error message mentions InternalGetGameObject, I assume it's trying to do the "tweenTarget.gameObject". Is 'tweenTarget' null?
Title: Re: WP8 UIButtonScale cause exception on OnHover
Post by: Lotti on July 10, 2014, 03:44:44 AM
No stripping is off, but we are using .net 2.0 subset.
Target may be null or not. Depends on how much i paid attention while developing the gui. However it seems to me that uibuttonscale works fine also with null target.
Title: Re: WP8 UIButtonScale cause exception on OnHover
Post by: ArenMook on July 10, 2014, 08:59:38 PM
It sets the target itself if it's null, as I recall. But if it's called before it's set, it can still be null. Either set it, or add a null check for that.