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.


Topics - Rafe

Pages: [1] 2
1
NGUI 3 Support / Upgrading to 3x....Did I miss the first step?
« on: November 11, 2013, 12:03:00 AM »
Hi,

In the directions it says:
Quote
First of all, before importing either of the packages, always follow the first
two steps of the upgrade process:

1. Start a new scene.
2. Delete the Examples, Resources, and Scripts folders within the NGUI folder.

As soon as I delete the old folders all components get disconnected. For example, UIRoot is not longer found.

The steps I took:
1) Did the two steps above
2) Imported the 3.0.4 and the Upgrade Tools
3) Fixed a couple of minor errors (quite early in our project).
4) Opened my main menu scene.

...all components are "missing" and running upgrade tools updates 0 items.

Any idea what I am doing wrong? As soon as I read the instructions I expected this outcome, but in the video everything was still working at the start so I gave it a shot.

Cheers,

2
NGUI 3 Support / Display stuck after update
« on: September 16, 2012, 01:42:07 PM »
i,

I just updated to v2.1.6 via the Asset Store. Before the update, when I hit play on a level, a menu scrolls offscreen and the level begins. After the update, the menu seems to be stuck on screen (render, not transforms). The GameObjects seem to still move offscreen and deactivate, but the menu is still visually stuck on-screen. Does that make sense?

Any idea what is going on?


[EDIT:] I just had to restart Unity and all works again....strange.

3
NGUI 3 Support / Feature Suggestions
« on: August 26, 2012, 02:54:50 PM »
Hi,

Just a couple of things that could be nice to have

1) It would be handy to have the "static" toggle in the Panel Tool window.

2) UICenterOnChild calls SpringPanel.Begin() with a hard-coded strength of 8. I branched the script for our project to make this a public field in the inspector.

4
NGUI 3 Support / UIDraggablePanel: Help with overshoot
« on: August 21, 2012, 12:53:13 AM »
Hi,

I'm hoping you can offer some advice. I think followed the example scene to setup a draggable/scrolling panel correctly. It mostly works. I have...
  1. UIDraggablePanel
  2. -- Grid
  3. -- -- UI Drag Panel Contents
  4. -- -- UI Drag Panel Contents
  5.  

Issues I need to solve:
  • The panel doesn't snap when released. The spring is too weak and drifts off rather than snaps. I tried to change the target of the spring panel to 0, and up the strength, but the panel takes over control and sets it to a value that is off zero. How can I get a crisp snap?
  • How do I reset the scroll back to its start position of 0? Should I just set the transform? I tried ResetPosition() but it threw an error

I need to learn how to do this quickly because the next widget I have to convert to nGUI is a programatically driven queue of icons that I need to pop, insert and scroll via script.

I did some searching and checked the examples, but I feel like I am missing something.


Cheers,

5
NGUI 3 Support / DestroyImmediate Bug
« on: August 19, 2012, 08:20:53 PM »
Hi,

Some of your code is allowing destroy immediate with a test: Application.isEditor

I think what you want here is !Application.isPlaying instead.

I'm getting some errors because from this. Specifically:
UIPanel OnDisable line 552:
  1.                         if (dc != null) NGUITools.DestroyImmediate(dc.gameObject);
  2.  

What I find confusing is that the NGUITools.Destroy() is already doing a destroy immedate when the game is not running, so I updated this line to call that method instead.
  1.             if (dc != null) NGUITools.Destroy(dc.gameObject);
  2.  

So far this change seems stable.

- Rafe

6
NGUI 3 Support / OnSelect Message Error
« on: August 19, 2012, 12:09:51 PM »
I've been getting this for some time but just got around to reporting it as it wasn't blocking. I'm not really sure where to begin debugging since it starts in Update() and I don't know anyway to follow a message. In other words, I'm not explicitly calling this code.

It seems to happen every time I switch between clicking on nGUI layers and "fall-through" layers. In real terms: My first click on the UI will trigger this error, then if I click around the UI it doesn't happen again... if I then click in the game I get the error, but as I click around the game I don't see it again, then if I click back in the UI, I see the error, etc....

MissingMethodException: The best match for method OnSelect has some invalid parameter.
  1. MissingMethodException: The best match for method OnSelect has some invalid parameter.
  2. System.MonoType.InvokeMember (System.String name, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object target, System.Object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, System.String[] namedParameters)
  3. UnityEngine.SetupCoroutine.InvokeMember (System.Object behaviour, System.String name, System.Object variable) (at C:/BuildAgent/work/d9c061b1c154f5ae/Runtime/Export/Coroutines.cs:18)
  4. UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
  5. UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:540)
  6. UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:991)
  7. UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:787)
  8. UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:648)
  9.  

Cheers,

- Rafe

7
NGUI 3 Support / UIImageButton Colliders getting destroyed and replaced
« on: August 12, 2012, 11:44:54 PM »
Hi,

I set up a panel of buttons and all seemed fine. I just went back to work on them and when I clicked through the button in the scene view (game not playing), my custom sphere colliders were destroyed and replaced with a new box collider. These two error messages where also printed:

  1. MissingReferenceException: The object of type 'SphereCollider' has been destroyed but you are still trying to access it.
  2. Your script should either check if it is null or you should not destroy the object.
  3. UnityEditor.Editor.IsEnabled () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/Editor.cs:197)
  4. UnityEditor.InspectorWindow.DrawEditors (Boolean isRepaintEvent, UnityEditor.Editor[] editors, Boolean eyeDropperDirty) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/InspectorWindow.cs:814)
  5. UnityEditor.InspectorWindow.OnGUI () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/InspectorWindow.cs:243)
  6. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
  7.  

  1. ArgumentException: Getting control 8's position in a group with only 8 controls when doing Repaint
  2. Aborting
  3. UnityEngine.GUILayoutGroup.GetNext () (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:417)
  4. UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:217)
  5. UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/BuildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:201)
  6. UnityEditor.InspectorWindow.CheckDragAndDrop (UnityEditor.Editor[] editors) (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/InspectorWindow.cs:368)
  7. UnityEditor.InspectorWindow.OnGUI () (at C:/BuildAgent/work/14194e8ce88cdf47/Editor/Mono/Inspector/InspectorWindow.cs:251)
  8. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
  9.  

Help!

Cheers,

- Rafe

8
NGUI 3 Support / Documentation Feedback: Message Events
« on: August 12, 2012, 11:27:20 PM »
Hi,

It would be helpful to add the types to the signatures of the events at: http://www.tasharen.com/ngui/docs/class_u_i_camera.html

It took me a good bunch of minutes to realize the OnDrag signature I was using was 'float delta' instead of 'Vector2 delta'. I figured it out with a chance search on these forums. The Unity error message was just "The best match for OnDrag has some invalid parameters."

Hope this helps,

- Rafe

9
NGUI 3 Support / Is there any reason to use a panel for visibility?
« on: August 05, 2012, 06:09:26 PM »
Hi,

I noticed SetActive takes a gameobject. Can I just use empty gameobjects for setting branches of my GUI visibility? Is there any reason to to stick to toggling panels?

I think I assumed this would be a good idea because of the Panel Tool (which is awesome by the way, and I will still use it for the big chunks regardless).

Cheers,

- Rafe

10
NGUI 3 Support / UISlider Inspector Slider Too Limited
« on: July 31, 2012, 02:08:31 AM »
Hi,

the UISlider inspector limits the steps, but the script doesn't. I needed 25 steps for a progress bar so I had to edit the inspector script.

I think setting this at an even 100 would be desirable, or making it an int field.


I need to know if you are willing to make this change in the next update. Otherwise I'll set this via script so I don't have to worry about an upgrade changing the settings.

This is an awesome feature by the way. I'm using it to make a retro blocky progress bar and it looks great!

Cheers,

11
NGUI 3 Support / Playing Animation Frames in a Different/Random Order
« on: July 29, 2012, 03:50:04 AM »
Hi,

I need to make two animations out of the same sprite-frames. The first is just the sequence in order, which works fine. For the second I want to play the frames randomly. Is there a way to do this without adding the frames to the atlas with a different name?

Cheers,

12
NGUI 3 Support / PoolManager + UIPanel = Pooled Widgets!
« on: July 25, 2012, 02:06:08 AM »
I just implemented our enemy life-bars and found out two great things...

1) I added a PoolManager SpawnPool component to the same GameObject as a UIPanel and it just works! Awesome! PoolManager, by default, parents everything under the SpawnPool's Transform, which is also what the UIPanel wants. I just dropped my life-bar prefab, set the pool to preload 10 bars and started the game. All the UISliders came in disabled (despawned) and when I spawn one it show up and everything works; still one draw call.

This is really really cool! It means I can add pools anywhere in my UI...flashes, etc, and it is still all one draw call with nothing ever being destroyed, which is huge on Mobile devices.

P.S. I'll add this to the PoolManager example patterns portion of our website and post it to the Unity Forums.

2) Thank you for the how-to, it worked perfectly. I ended up centering the UISlider using startPos.x -= this.bar.fullSize.x * 0.5f;  where startPos i the target position before casting in to the camera viewport space. Someone in the thread mentioned it, but I didn't see it in the posted sample code.

13
NGUI 3 Support / Event listener not doing anything...
« on: July 22, 2012, 04:23:21 AM »
Hi,

I think I am setting this up correctly:

  1.    
  2.     // In the class
  3.     public UIImageButton playButton;        
  4.  
  5.     // in Start()
  6.     UIEventListener.Get(this.playButton.gameObject).onClick += this.OnPlay;
  7.  
  8.     // My func definition
  9.     public void OnPlay(GameObject obj)
  10.     {
  11.         Debug.Log("OnPlay");
  12.     }
  13.    

  • The log message never plays and there are no error messages.
  • I attached a test script and the button IS getting an OnClick event
  • When I play the game no UIEventListener component is added to the gameObject. I tried adding one manually and it didn't have any effect.

Any thoughts?

14
NGUI 3 Support / UIImageButton Disabled Sprite Image?
« on: July 18, 2012, 06:56:20 PM »
Hi,

Is there a way to display an image when the button is in a disabled state? I see:
normalSprite
hoverSprite
pressedSprite

I was hoping for
disabledSprite


Also, did I read correctly that the way to disable a button (still visible but no longer accepting input) is to disable the collider component?

Cheers,

15
NGUI 3 Support / New User Install Notes
« on: July 18, 2012, 12:51:52 AM »
Hi,

I wanted to post this while it is still fresh.

1) Is there a reason why you don't use the Plugins and Editor folders? All of our plugins are distributed to do this and it works great! This is pretty standard and it keeps things clean and works for JavaScript users, since these assemblies run first. You can also use the internal modifier in your code which can be handy. Folder structure example...
    Assets
        Plugins
            nGUI
                ...
        Editor
            nGUI
                ...

2) You use a lot of the same component names as EZGUI, which we also have. I had to refactor some code and reinstall to get nGUI to work. I am generally a fan of generic naming, but it would be nice to add use "nGUI" instead of "UI" as a prefix. I know changing this would require all users to update their code, but I wanted to point it out, even if just to warn others before import.


Awesome, awesome job!

Pages: [1] 2