UIFrame.Show<LoginPanel>(data); 执行后一直转圈圈
private void Awake() { if (canvas == null) throw new Exception("UIFrame初始化失败,请设置Canvas"); if (canvas.worldCamera == null) throw new Exception("UIFrame初始化失败,请给Canvas设置worldCamera"); if (layers == null) throw new Exception("UIFrame初始化失败,请设置layers"); Canvas = canvas; Camera = canvas.worldCamera; layerTransform = layers; layerTransform.anchorMin = Vector2.zero; layerTransform.anchorMax = Vector2.one; layerTransform.offsetMin = Vector2.zero; layerTransform.offsetMax = Vector2.zero; DontDestroyOnLoad(gameObject); AutoBindUITimer.Enable(); AutoBindUGUIButtonEvent.Enable(); Debug.Log("UIFrame初始化成功"); }
这里已经执行到了,下面是打印顺序
UIFrame初始化成功 UnityEngine.Debug:Log (object) Feif.UIFramework.UIFrame:Awake () (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:86) UnityEngine.Object:Instantiate<UnityEngine.GameObject> (UnityEngine.GameObject) YooAsset.InstantiateOperation:InstantiateInternal (UnityEngine.Object,bool,UnityEngine.Vector3,UnityEngine.Quaternion,UnityEngine.Transform,bool) (at Library/PackageCache/[email protected]/Runtime/ResourceManager/Operation/InstantiateOperation.cs:126) YooAsset.AssetHandle:InstantiateSyncInternal (bool,UnityEngine.Vector3,UnityEngine.Quaternion,UnityEngine.Transform,bool) (at Library/PackageCache/[email protected]/Runtime/ResourceManager/Handle/AssetHandle.cs:147) YooAsset.AssetHandle:InstantiateSync () (at Library/PackageCache/[email protected]/Runtime/ResourceManager/Handle/AssetHandle.cs:97) LoadDll:Handle_Completed (YooAsset.AssetHandle) (at Assets/Main/LoadDll.cs:332) YooAsset.AssetHandle:add_Completed (System.Action`1<YooAsset.AssetHandle>) (at Library/PackageCache/[email protected]/Runtime/ResourceManager/Handle/AssetHandle.cs:29) LoadDll/<Run_InstantiateComponentByAsset>d__22:MoveNext () (at Assets/Main/LoadDll.cs:326) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
Prefab name is UIFrame(Clone) UnityEngine.Debug:Log (object) LoadDll:Handle_Completed (YooAsset.AssetHandle) (at Assets/Main/LoadDll.cs:333) YooAsset.AssetHandle:add_Completed (System.Action`1<YooAsset.AssetHandle>) (at Library/PackageCache/[email protected]/Runtime/ResourceManager/Handle/AssetHandle.cs:29) LoadDll/<Run_InstantiateComponentByAsset>d__22:MoveNext () (at Assets/Main/LoadDll.cs:326) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
NullReferenceException: Object reference not set to an instance of an object
Feif.UIFramework.UIFrame.RequestInstance (System.Type type, Feif.UIFramework.UIData data) (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:502)
Feif.UIFramework.UIFrame.ShowAsync (System.Type type, Feif.UIFramework.UIData data) (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:764)
UnityEngine.Debug:LogException(Exception)
Feif.UIFramework.<ShowAsync>d__87:MoveNext() (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:805)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:Start(<ShowAsync>d__87&) Feif.UIFramework.UIFrame:ShowAsync(Type, UIData) Feif.UIFramework.UIFrame:Show(Type, UIData) (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:176) Feif.UIFramework.<ShowAsync>d__861:MoveNext() (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:737)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1:Start(<ShowAsync>d__861&)
Feif.UIFramework.UIFrame:ShowAsync(UIData)
Feif.UIFramework.UIFrame:Show(UIData) (at Assets/3rdParty/UIFrame/Runtime/Core/UIFrame.cs:166)
StartUp:Start() (at Assets/HotUpdate/StartUp.cs:31)
有时间也可以上Q帮忙看看,谢谢