Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: skullthug on November 24, 2013, 02:38:35 PM

Title: 3.0.6 rc3 generates compiler error when doing javascript workaround
Post by: skullthug on November 24, 2013, 02:38:35 PM
The project I'm working on is entrenched with javascript, so to make NGUI work with it I've been doing the workaround (http://www.tasharen.com/forum/index.php?topic=1763.0) of moving the Interaction, Internal, Tweening, and UI folders to be in the Plugins folder so they compile in the right order. After upgrading to 3.0.6rc from 3.0.5 though I'm now getting the following:

Assets/Plugins/NGUI/Internal/NGUITools.cs(358,34): error CS0117: `UnityEditor.Undo' does not contain a definition for `RecordObject'


Any idea what to do?
(I deleted all NGUI scripts/folders and imported the package, as stated in the instructions)
Title: Re: 3.0.6 rc3 generates compiler error when doing javascript workaround
Post by: ArenMook on November 24, 2013, 04:38:46 PM
What version of Unity? I'm guessing it's not the latest.
Title: Re: 3.0.6 rc3 generates compiler error when doing javascript workaround
Post by: skullthug on November 24, 2013, 06:10:36 PM
4.2.2f1

I'm guessing 4.3 is required?
Title: Re: 3.0.6 rc3 generates compiler error when doing javascript workaround
Post by: ArenMook on November 24, 2013, 06:24:43 PM
No, just means I can only test it on the latest versions. You can fix that by changing the RegisterUndo function to the following:
  1.         static public void RegisterUndo (UnityEngine.Object obj, string name)
  2.         {
  3. #if UNITY_EDITOR
  4.  #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2
  5.                 UnityEditor.Undo.RegisterUndo(obj, name);
  6.  #else
  7.                 UnityEditor.Undo.RecordObject(obj, name);
  8.  #endif
  9.                 UnityEditor.EditorUtility.SetDirty(obj);
  10. #endif
  11.         }
Title: Re: 3.0.6 rc3 generates compiler error when doing javascript workaround
Post by: skullthug on November 24, 2013, 06:38:18 PM
That fixed it. Awesome, thanks for responding so quickly!
Also, thank you so much for adding gradient text and x/y spacing. Ever since you put it in the version list I've been dying to get 3.0.6 :)