Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: BehindTheStone on February 09, 2015, 05:12:04 PM

Title: Sprite does not contain a definition for 'border'
Post by: BehindTheStone on February 09, 2015, 05:12:04 PM
Hey there.

Imported the latest nGUI Version to my clean new 4.3.X Unity PS Vita Project and got these two errors:

  1. Assets/NGUI/Scripts/Editor/UI2DSpriteEditor.cs(42,46): error CS1061: Type `UnityEngine.Sprite' does not contain a definition for `border' and no extension method `border' of type `UnityEngine.Sprite' could be found (are you missing a using directive or an assembly reference?)

  1. Assets/NGUI/Scripts/Editor/UI2DSpriteEditor.cs(42,46): error CS1061: Type `UnityEngine.Sprite' does not contain a definition for `border' and no extension method `border' of type `UnityEngine.Sprite' could be found (are you missing a using directive or an assembly reference?)
Title: Re: Sprite does not contain a definition for 'border'
Post by: Nicki on February 09, 2015, 06:58:53 PM
As far as I know, 4.3 isn't really supported anymore. That said, I believe the only problem should be that one - just commed out the entirety of UI2DSpriteEditor and it should work again.

I'm not sure when the borders were added to unity sprites, but right now that's where NGUI supports from. (4.6?)
Title: Re: Sprite does not contain a definition for 'border'
Post by: BehindTheStone on February 10, 2015, 03:30:02 AM
What? Really? That's really a problem since we need a decent GUI solution for our work on consoles. Hm...

So I only should comment out the whole class?
Title: Re: Sprite does not contain a definition for 'border'
Post by: ArenMook on February 10, 2015, 05:24:48 AM
NGUI has been built with Unity 4.5 for many months now. You can take the package and import it in 4.3, but there are parts of the code like the one you found that will need to be adjusted. It's easier to do if you have Professional level access and have full history of files -- you can then just check to see what changed. In most cases it's simply a removal of an #ifdef.
Title: Re: Sprite does not contain a definition for 'border'
Post by: BehindTheStone on February 10, 2015, 05:55:42 AM
So in this specific case what shall I comment out or remove exactly? The whole class or only some lines?
Title: Re: Sprite does not contain a definition for 'border'
Post by: Nicki on February 11, 2015, 03:20:19 AM
You'll need to remove all references to Unity's sprites, I believe.
 
That means, the contents of UI2DSprite, all of UI2DSpriteEditor, UI2dSpriteAnimation where it references UnityEngine.Sprite. Essentially anywhere else that it references UnityEngine.Sprite.


If you leave the UI2DSprite class existing (but empty), you may not need to remove it from quite so many places.
Title: Re: Sprite does not contain a definition for 'border'
Post by: BehindTheStone on February 11, 2015, 04:42:35 AM
Yesterday I just commented out the two lines of code which gave me the errors and then everything seemed to work fine.
But I'll keep your suggestion in mind, thanks!
Title: Re: Sprite does not contain a definition for 'border'
Post by: Nicki on February 11, 2015, 06:21:40 AM
Heh, I may be overstating the problem then. Did the built in unity 2d stuff come already in 4.3? Then it's only certain late additions that would break, like Borders. If so, phew, much easier. :D
Title: Re: Sprite does not contain a definition for 'border'
Post by: BehindTheStone on February 11, 2015, 06:54:24 AM
Yep, the 2D Stuff came in 4.3 :)