Hi,
I have a scene with a 2D UIRoot which takes care of the main game. I also have a Scoreboard and another item menu that I would like to switch to on a button press. I have configured this so that each one of these has a 2D UIRoot with their own Layer. So for instance, the main game layer is 'NGUI', the Scoreboard is 'Scoreboard', and so on. I only have the one camera however, which is in the main game UIRoot. To switch to the different menus I change the culling mask on the camera and also the EventMask on the UIcamera component . The layers are switching fine and events are working. Would this be the correct way to do this kind of switching?
However I am getting an error which occurs even when the game is not running.
The hierarchy of the menu UIRoots is as follows;
UIRoot
> Panel
>>Background
>>> Other object...
Any help would be great - Thanks
(Using NGUI 3.7.0)
The error is:
NullReferenceException: Object reference not set to an instance of an object
UIPanel.get_worldCorners () (at Assets/NGUI/Scripts/UI/UIPanel.cs:598)
UIPanelInspector.OnSceneGUI () (at Assets/NGUI/Scripts/Editor/UIPanelInspector.cs:82)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.SceneView.CallOnSceneGUI () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/SceneView.cs:1688)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/SceneView.cs:1093)
UnityEditor.SceneView.OnGUI () (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/SceneView/SceneView.cs:970)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)