Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kruncher

Pages: 1 2 [3] 4 5 6
31
NGUI 3 Support / Animation seems to skip to end on iPad1
« on: December 13, 2013, 09:26:28 AM »
Hey guys

I have several animated NGUI object hierarchies which play perfectly on the desktop. But on my iPad1 the animation seems to instantly skip all of the keyframes and appear in the final stage. This happens instantly, there is no lag or drop in FPS.

My animation is triggered simply by enabling the root GUI object. The animator component (as per default) automatically plays the animation from the start each time the game object is enabled.

Any ideas as to why this is happening? or things to look for?

Cheers!

32
NGUI 3 Support / Heads Up! "Sprite is not rectangle-packed" exception
« on: December 12, 2013, 05:15:17 PM »
Just a little heads up in case others experience this exception!

The default packing setting for Unity 4.3 sprites is "tight" which means that you cannot use Sprite.rect to calculate the sprite UVs:
  1. UnityException: Sprite is not rectangle-packed. TextureRect is invalid.
  2. UI2DSprite.get_uvRect () (at Assets/NGUI/Scripts/UI/UI2DSprite.cs:181)
  3. UI2DSprite.OnFill (.BetterList`1 verts, .BetterList`1 uvs, .BetterList`1 cols) (at Assets/NGUI/Scripts/UI/UI2DSprite.cs:241)
  4. UIWidget.UpdateGeometry (Boolean visible) (at Assets/NGUI/Scripts/Internal/UIWidget.cs:1163)
  5. UIPanel.UpdateWidgets () (at Assets/NGUI/Scripts/UI/UIPanel.cs:980)
  6. UIPanel.LateUpdate () (at Assets/NGUI/Scripts/UI/UIPanel.cs:874)
  7.  
Until the "tight" UV data is exposed, people will need to manually set "Mesh Type" (using the texture importer of their sprite) to "Full Rect". This resolves the issue :)

33
NGUI 3 Support / Re: "NGUI" menu inside project window
« on: December 12, 2013, 03:58:08 PM »
Btw, a note about the separator which appears below the "Assets/Create" submenu. This one seems to break the rule and so perhaps is inserted explicitly by the Unity menu generation code. i.e. doesn't use the 'MenuItem" attribute. That is purely a guess.

34
NGUI 3 Support / Re: "NGUI" menu inside project window
« on: December 12, 2013, 03:55:11 PM »
Quote
How did you figure this out?
After a LOT of trial and error and a question to Shawn White ;)

My asset makes heavy use of menu items and their ordering so I felt that this was important to figure out.

Quote
And the separator -- I assume it occurs after....?
The separator will appear above items which are set apart by increments of 30, though in my opinion increments of 100 is neater and easier to maintain.
  1. // Separators at increments of 30
  2. [MenuItem("Test/ABC/1", false, 10)]
  3. static void ABC_1() {
  4. }
  5. [MenuItem("Test/ABC/2", false, 10)]
  6. static void ABC_2() {
  7. }
  8. [MenuItem("Test/ABC/3", false, 10)]
  9. static void ABC_3() {
  10. }
  11. [MenuItem("Test/ABC/4", false, 10)]
  12. static void ABC_4() {
  13. }
  14. [MenuItem("Test/ABC/5", false, 30)]
  15. static void ABC_5() {
  16. }
  17. [MenuItem("Test/ABC/6", false, 60)]
  18. static void ABC_6() {
  19. }
  20.  
  21. // Separators at increments of 100
  22. [MenuItem("Test/DEF/1", false, 100)]
  23. static void DEF_1() {
  24. }
  25. [MenuItem("Test/DEF/2", false, 200)]
  26. static void DEF_2() {
  27. }
  28.                
  29. [MenuItem("Test/GHI/1", false, 200)]
  30. static void GHI_1() {
  31. }
  32. [MenuItem("Test/GHI/2", false, 300)]
  33. static void GHI_2() {
  34. }
  35.  

Screen shots of above menu:
http://pbrd.co/JbTqlG
http://pbrd.co/JbTuBT
http://pbrd.co/JbTx0z

I hope that this helps, but please let me know if you have further questions and I will do my best to help :)

35
NGUI 3 Support / Re: "NGUI" menu inside project window
« on: December 12, 2013, 01:51:34 PM »
In the case of this example, 30 is the position of "NGUI2" within "Assets", but it also represents the very first item in the "NGUI2" submenu. For example:
  1.     [MenuItem("Assets/NGUI2/A", false, 30)]
  2.     static void A() {
  3.     }
  4.    
  5.     [MenuItem("Assets/NGUI2/B", false, 300)]
  6.     static void B() {
  7.     }
  8.    
  9.     [MenuItem("Assets/NGUI2/C", false, 31)]
  10.     static void C() {
  11.     }
  12.    
  13.     [MenuItem("Assets/NGUI2/D", false, 30)]
  14.     static void D() {
  15.     }
  16.  
will produce:
  1. - Select Dependencies(30)
  2. - NGUI2(30)
  3.     - A(30)
  4.     - D(30)
  5.     - C(31)
  6.     ----------
  7.     - B(300)
  8. --------------------
  9. - Refresh(40)
  10.  

36
NGUI 3 Support / Re: "NGUI" menu inside project window
« on: December 12, 2013, 01:24:35 PM »
The ordering within the root menu is taken from the first item in your sub-menu. So for example, the following:
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. public static class TestMenu {
  5.  
  6.         [MenuItem("Assets/NGUI2/A", false, 30)]
  7.         static void A() {
  8.         }
  9.        
  10.         [MenuItem("Assets/NGUI2/B", false, 300)]
  11.         static void B() {
  12.         }
  13.        
  14.         [MenuItem("Assets/NGUI2/C", false, 300)]
  15.         static void C() {
  16.         }
  17.  
  18. }
  19.  
will produce the following:
http://pasteboard.co/1WZBK4hg.png

But, with that said, Unity hasn't left any gaps within their numbering scheme. I personally work with increments of 100 with my menus so that they are easier to extend by other developers.

The nearest I could get to where I suggested was with priorities ranging between 20 and 29. But these do not seem ideal. Perhaps this will help anyhow :)

37
NGUI 3 Support / "NGUI" menu inside project window
« on: December 12, 2013, 09:17:54 AM »
Hey there!

I find the "NGUI" menu in the project window useful, though I think it would be better if it were positioned lower down (for example, between "Delete" and "Import New Asset...").

I am so used to right-clicking and heading straight for the regular Unity "Create" menu. This isn't a major issue, but it would be nice if NGUI didn't mess with the position of "Create" :P

As always, keep up the great work!

38
NGUI 3 Support / Is there a new alternative for "Fill Keeping Ratio?
« on: December 11, 2013, 07:46:31 AM »
Hey there!

The new layout system seems to replace UIAnchor and UIStretch beautifully though I am left with a couple of UIStretch components for which I am a little unsure with:

Ui Camera = Camera
Container = Panel
Style = FillKeepingRatio
Relative Size = X: 1, Y: 1
Initial Size = X: 1024, Y: 768
Border Padding = X: 0, Y: 0

What would this translate to with the new layout mechanism?

39
NGUI 3 Support / Re: Unable to animate widget colour now
« on: December 10, 2013, 01:25:51 AM »
Ah, must have been a fluke!

I wasn't aware of the intermediary script, made the adjustment and works again!

Thanks :)

40
NGUI 3 Support / Re: Unable to animate widget colour now
« on: December 10, 2013, 01:05:43 AM »
I animated the colour using using the animation window by creating two keyframes. This has been working great, but seems to have broken recently.

41
NGUI 3 Support / Unable to animate widget colour now
« on: December 10, 2013, 01:01:43 AM »
Hey there

I have just finished updating my GUI to use the fantastic new layout system which was introduced a couple of days ago and am absolutely loving it! I tend to find myself using the "Unified" and "Advanced" mode most and they are great :D

I have noticed that the widget colour no longer animates though. The colour adjusts properly in the inspector, but the visual representation does not update unless I toggle the panel off/on.

Any ideas?

Cheers!

42
NGUI 3 Support / Re: UISlider.fullSize gone :(
« on: December 07, 2013, 07:16:53 PM »
Fantastic stuff! thanks :D

43
NGUI 3 Support / Re: Problem with UISlider with Vertical Filled Sprite
« on: December 07, 2013, 09:23:18 AM »
The problem seems to occur if the first update is less than 1 (as is the case in that screenshot). Perhaps this is some sort of execution order issue?

Edit: I set the execution order for UISlider to -100 and this resolved the problem. So it seems that the default execution order is different for the new version of NGUI... or perhaps an implementation change which has become dependent upon execution order.

44
NGUI 3 Support / Problem with UISlider with Vertical Filled Sprite
« on: December 07, 2013, 09:18:29 AM »
Okay, this is working in the previous asset store release of NGUI, but has broken in the latest release.

I have a sprite which is just a green circle which is used as a vertical progress meter. I have another script which keeps its value in sync with the game state.

When the game first starts the meter becomes squashed, and remains squashed for the duration of the game. During play mode, if I delete the widget and then select Edit|Undo it corrects itself.

If I remove "mySlider.value = healthPercentage;" from within the "Update" function of my script it also behaves. The problem only seems to occur when the game first instantiates the GUI from a prefab. If I begin the game with my update script disabled, and then enabled it in-game, the widget renders properly.

Here is a screenshot:
http://pbrd.co/IRCFMl

The widget on the left is how it incorrectly looks upon starting the game. The widget on the right is how it should look.

If the widget on the left is duplicated (Ctrl+D) during play mode, it appears properly (the one on the right is a clone).

45
NGUI 3 Support / Re: UISlider.fullSize gone :(
« on: December 07, 2013, 08:10:09 AM »
Wow, well done on the new layout system! it is a vast improvement and resolves this issue!

When selecting an anchor for the first time it feels like it would be handy if it automatically initialised the game object to the first parent that is a widget. Would be a huge time saver!

Thanks :)

Pages: 1 2 [3] 4 5 6