[Unity][Fairygui]GList更新出错

if (list_.itemProvider!=null
&& list_.itemRenderer != null)
{
list_.itemProvider -= GetListItemResource;
list_.itemRenderer -= RenderListItem;
}
list_.itemProvider = GetListItemResource;
list_.itemRenderer = RenderListItem;
list_.onClickItem.Add(clickItem);
 
list_.numItems = arrary[index];//报错IL_028c: callvirt System.Void FairyGUI.GList::set_numItems(System.Int32)
 
NullReferenceException: Object reference not set to an instance of an object
FairyGUI.GComponent.AddChildAt (FairyGUI.GObject child, System.Int32 index) (at Assets/FairyGUI-unity-master/Assets/Scripts/UI/GComponent.cs:230)
FairyGUI.GList.AddChildAt (FairyGUI.GObject child, System.Int32 index) (at Assets/FairyGUI-unity-master/Assets/Scripts/UI/GList.cs:383)
FairyGUI.GComponent.AddChild (FairyGUI.GObject child) (at Assets/FairyGUI-unity-master/Assets/Scripts/UI/GComponent.cs:216)
FairyGUI.GList.AddItemFromPool (System.String url) (at Assets/FairyGUI-unity-master/Assets/Scripts/UI/GList.cs:372)
FairyGUI.GList.set_numItems (System.Int32 value) (at Assets/FairyGUI-unity-master/Assets/Scripts/UI/GList.cs:1563)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <9577ac7a62ef43179789031239ba8798>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <9577ac7a62ef43179789031239ba8798>:0)
ILRuntime.CLR.Method.CLRMethod.Invoke (ILRuntime.Runtime.Intepreter.ILIntepreter intepreter, ILRuntime.Runtime.Stack.StackObject* esp, System.Collections.Generic.IList`1[T] mStack, System.Boolean isNewObj) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.6/CLR/Method/CLRMethod.cs:316)
ILRuntime.Runtime.Intepreter.ILIntepreter.Execute (ILRuntime.CLR.Method.ILMethod method, ILRuntime.Runtime.Stack.StackObject* esp, System.Boolean& unhandledException) (at Library/PackageCache/com.ourpalm.ilruntime@1.6.6/Runtime/Intepreter/ILIntepreter.cs:1839)
Rethrow as ILRuntimeException: Exception has been thrown by the target of an invocation.
已邀请:

谷主

赞同来自:

都有堆栈了,自己debug。

要回复问题请先登录注册