Author Topic: 3.0.6 compile error  (Read 8642 times)

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
3.0.6 compile error
« on: November 23, 2013, 11:03:52 AM »
After updating to 3.0.6 (deleted the old folder etc.) I get the following error:

"Assets/NGUI/Scripts/Editor/UIWidgetContainerEditor.cs(110,32): error CS0136: A local variable named `b' cannot be declared in this scope because it would give a different meaning to `b', which is already used in a `child' scope to denote something else"

No earlier issues. Unity version 4.2.2f1.

Thanks in advance

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6 compile error
« Reply #1 on: November 23, 2013, 11:14:07 AM »
Thanks -- resolved. You can grab the latest again, or replace that #if section with:
  1. #if !UNITY_3_5
  2.                         // Change the mouse cursor to a more appropriate one
  3.                         Vector2[] screenPos = new Vector2[8];
  4.                         for (int i = 0; i < 8; ++i) screenPos[i] = HandleUtility.WorldToGUIPoint(worldPos[i]);
  5.  
  6.                         bounds = new Bounds(screenPos[0], Vector3.zero);
  7.                         for (int i = 1; i < 8; ++i) bounds.Encapsulate(screenPos[i]);
  8.  
  9.                         // Change the cursor to a move arrow when it's within the screen rectangle
  10.                         Vector2 min = bounds.min;
  11.                         Vector2 max = bounds.max;
  12.                         Rect rect = new Rect(min.x, min.y, max.x - min.x, max.y - min.y);
  13.                         UIWidgetInspector.SetCursorRect(rect, isWithinRect ? MouseCursor.MoveArrow : MouseCursor.Arrow);
  14. #endif

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #2 on: November 23, 2013, 11:19:51 AM »
Thanks -- resolved. You can grab the latest again, or replace that #if section with:

Thanks for the swift response! We purchased through the Asset Store, I am guessing you refer to professional customers being able to grab it at once?

Off topic question: Would you say there still is benefit to upgrading to Pro given that the new Unity GUI is...imminent? ;)

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #3 on: November 23, 2013, 11:22:35 AM »
Changing that code as instructed yields a new one:
Quote
Assets/NGUI/Scripts/Editor/UIPanelInspector.cs(23,9): error CS0576: Namespace `global::' contains a definition with same name as alias `Action'

I am a bit surprised this was pushed to the Asset Store in the given state, or are these errors somehow related to our Unity version or setup somehow? If they affect all Asset Store customers I would be a bit concerned...

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #4 on: November 23, 2013, 11:24:22 AM »
Never mind. A bit too quick on the trigger. Our project contains a class called Action, clashing with that alias. Could you please change the alias name as it is a bit poorly chosen. I would guess Action could be a popular class name. ;)

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #5 on: November 23, 2013, 11:27:39 AM »
Another one, and not due to a naming clash:
Quote
Assets/NGUI/Scripts/Editor/NGUIContextMenu.cs(363,22): error CS0117: `UnityEditor.Undo' does not contain a definition for `DestroyObjectImmediate'

So, I go back to my statement that this was not mature enough for the Asset Store. ;)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6 compile error
« Reply #6 on: November 23, 2013, 11:32:15 AM »
http://docs.unity3d.com/Documentation/ScriptReference/Undo.DestroyObjectImmediate.html

Current build works on both latest releases of 3.X and 4.X cycles. I am guessing you have some older version of Unity?

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #7 on: November 23, 2013, 11:35:14 AM »
Define older? ;)
4.2.2f1.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6 compile error
« Reply #8 on: November 23, 2013, 11:37:45 AM »
:P

You can fix it locally by addinf a few more #if clauses to that statement.
  1. #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2
  2.                 NGUITools.Destroy(go);
  3. #else
  4.                 Undo.DestroyObjectImmediate(go);
  5. #endif
Unfortunately I only test with 3 versions of Unity -- latest 3.X (3.5.7), latest public 4.X (4.3), and latest alpha 4.X (4.5).

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #9 on: November 23, 2013, 11:38:08 AM »
Very strange. Neither the local documentation for Undo nor the MonoDevelop help lists DestroyObjectImmediate as a valid function. I guess something must be amiss with 4.2.2f1 or my installation of it.

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #10 on: November 23, 2013, 11:40:40 AM »
Ok, so that function was presumably added in 4.3. Well, I was about to upgrade anyway.

Another question: Since 3.0.5 I get no visible indication of the panel clipping settings (no visible border). Is this by design or another possible conflict related to 3.0.x/4.2.x ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6 compile error
« Reply #11 on: November 23, 2013, 11:41:28 AM »
3.0.5 and earlier doesn't show border in 3D UIs. 3.0.6 does.

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #12 on: November 23, 2013, 11:43:51 AM »
3.0.5 and earlier doesn't show border in 3D UIs. 3.0.6 does.
3.0.6 does not show me a border when I enable soft clipping. The clipping does work, but no border...

I could have sworn it did show a border in 2.x...

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: 3.0.6 compile error
« Reply #13 on: November 23, 2013, 11:44:21 AM »
Did you collapse the component in inspector? When you do that, all gizmos go away.

danfoo

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 2
  • Posts: 93
    • View Profile
Re: 3.0.6 compile error
« Reply #14 on: November 23, 2013, 11:47:33 AM »
Nope, but it was my fault anyway. When NGUI broke, Unity messed up my UI settings and when I recreated them I mixed up scene/game views on the wrong monitors, so I was looking a the game view.  :o :(

Sorry!

Anyway, no more errors and I will upgrade to 4.3 to be in sync with future releases. You might want to add that 4.2 check to the live version as well since I would guess others are still on 4.x as well.