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 - Rafe

Pages: 1 2 [3] 4 5 6
31
NGUI 3 Support / Re: DestroyImmediate Bug
« on: August 20, 2012, 11:06:33 PM »
Any idea how to tell? It is a pretty common event. Something enters a collider trigger and it triggers deactivation. This is the first time I have encountered a need to destroy-immediate during game play.

32
NGUI 3 Support / Re: DestroyImmediate Bug
« on: August 20, 2012, 01:30:22 AM »
I see that now. When I load the level it is fine, but if I start the game with that scene it is a problem.

So, how can I stop the error? Granted it should only occur in the Editor, but there must be a way to run error free. Any idea what this error may cause?

Does it have anything to do with SetActiveRecursively?

  1. Destroying object immediately is not permitted during physics trigger and contact callbacks. You must use Destroy instead.
  2. UnityEngine.Object:DestroyImmediate(Object)
  3. NGUITools:DestroyImmediate(Object) (at Assets/NGUI/Scripts/Internal/NGUITools.cs:449)
  4. UIPanel:OnDisable() (at Assets/NGUI/Scripts/UI/UIPanel.cs:552)
  5. UnityEngine.GameObject:SetActiveRecursively(Boolean)   //  <--- Run by another plugin
  6. [...snip...]
  7.  

33
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

34
NGUI 3 Support / Re: OnSelect Message Error
« on: August 19, 2012, 05:25:25 PM »
Yes, found it!!

Changed mine to OnSelected and the error is gone.

I wish Unity would print something helpful since they made the call so generic!

Thanks for the help.

35
NGUI 3 Support / Re: OnSelect Message Error
« on: August 19, 2012, 04:27:58 PM »
That is the latest UICamera script as far as I know. I just updated from the Asset Store. I did not edit the code (I never do, I always copy code if I am going to work on a third party plugin)

I know what the error means ;) I posted the traceback as part of a bug report. Here is the line in Notify at line 540:
  1.     static void Notify (GameObject go, string funcName, object obj)
  2.     {
  3.         [...snip....]
  4.             go.SendMessage(funcName, obj, SendMessageOptions.DontRequireReceiver);   // <----- line 540
  5.             [...snip....]
  6.  
I searched for all references and it looks like UICamera is the only script that runs this. The lines that I see that run Notify with an "OnSelect" message are:
  1. ...NGUI\Scripts\UI\UICamera.cs - (305, 7) : Notify(mSel, "OnSelect", false);
  2. ...NGUI\Scripts\UI\UICamera.cs - (322, 7) : Notify(mSel, "OnSelect", true);
  3. ...NGUI\Scripts\UI\UICamera.cs - (991, 7) : Notify(currentTouch.pressed, "OnSelect", true);
  4.  

Note they all pass a bool but the function takes an object. Is bool derived from object?

36
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

37
Hi Aren,

I finally had a little time to debug this and it is being caused by this line in a custom version of the UIImage inspector:
  1. NGUITools.AddWidgetCollider(mButton.gameObject);

If I comment this out, my Sphere Collider stops being destroyed. Here is the problem code:
Line 275 of NGUITools.cs...
  1.                         if (box == null)
  2.                         {
  3.                                 if (col != null)
  4.                                 {
  5.                                         if (Application.isPlaying) GameObject.Destroy(col);
  6.                                         else GameObject.DestroyImmediate(col);
  7.                                 }
  8.                                 box = go.AddComponent<BoxCollider>();
  9.                         }
This says if there is a collider that isn't a box, destroy it. Do you recall why?

Cheers,

- Rafe

38
NGUI 3 Support / Re: Documentation Feedback: Message Events
« on: August 13, 2012, 01:00:51 AM »
"could", but didn't. I'm not saying it was smart, but it happened and I figured sharing would help someone. These things happen in development.

39
"what did you do"

Jiggled the knobs (reverted the prefab, updated nGUI, rebooted Unity) and it fixed itself. Seems to be stable. Moving on...


[EDIT] Its back. I'll have to tackle this with some fresh eyes tomorrow.

40
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

41
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

42
NGUI 3 Support / Re: Atlas-update problem
« on: August 06, 2012, 10:43:31 PM »
Well I switched to a sliced sprite again and it worked this time. I wish I new what I did. Probably just an inspector update or something. All good now though.

Thanks again!

43
NGUI 3 Support / Re: Atlas-update problem
« on: August 06, 2012, 08:54:21 PM »
I tried replacing the foreground with a sliced sprite but when I change the UISlider value the sliced sprite just translates back and forth and disappears when the slider is zero. Any idea what I am doing wrong?

44
NGUI 3 Support / Re: Atlas-update problem
« on: August 06, 2012, 02:05:49 PM »
My apologies. The sprite was NOT a sliced sprite. I was confusing it with another setup. It IS sharp with a sliced sprite. So...

I changed the background of the UISlider to a sliced sprite, but the foreground still has to be sliced to work. Is there such thing as a sliced+filled sprite? A simple progress bar is a great use for sliced sprites.

Thanks for sticking with me. Noob mistakes!

45
NGUI 3 Support / Re: Atlas-update problem
« on: August 05, 2012, 07:46:03 PM »
As I mentioned, specify a border on the sprite. Select the atlas, choose your sprite, put '1' for all 4 border values.

I understand. I have tried that. Please see the attached image. It shows the boarder settings and the result. My question is, is there a way to crop in on the image so the blurry pixel, which is inside the boarder, is not displayed?

Cheers,

Pages: 1 2 [3] 4 5 6