瀏覽代碼

修改Debug工具

taochangchun 1 周之前
父節點
當前提交
10ccabc268

+ 26 - 5
Resources/UI/Console.prefab

@@ -174,7 +174,7 @@ GameObject:
174 174
   m_Icon: {fileID: 0}
175 175
   m_NavMeshLayer: 0
176 176
   m_StaticEditorFlags: 0
177
-  m_IsActive: 0
177
+  m_IsActive: 1
178 178
 --- !u!224 &422381412483780943
179 179
 RectTransform:
180 180
   m_ObjectHideFlags: 0
@@ -1425,7 +1425,7 @@ RectTransform:
1425 1425
   m_RootOrder: 0
1426 1426
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
1427 1427
   m_AnchorMin: {x: 0, y: 0}
1428
-  m_AnchorMax: {x: 1, y: 1}
1428
+  m_AnchorMax: {x: 0, y: 0}
1429 1429
   m_AnchoredPosition: {x: 0, y: 0}
1430 1430
   m_SizeDelta: {x: 20, y: 20}
1431 1431
   m_Pivot: {x: 0.5, y: 0.5}
@@ -1521,7 +1521,7 @@ MonoBehaviour:
1521 1521
   m_EditorClassIdentifier: 
1522 1522
   m_IgnoreLayout: 0
1523 1523
   m_MinWidth: -1
1524
-  m_MinHeight: -1
1524
+  m_MinHeight: 80
1525 1525
   m_PreferredWidth: -1
1526 1526
   m_PreferredHeight: 100
1527 1527
   m_FlexibleWidth: -1
@@ -2200,7 +2200,7 @@ RectTransform:
2200 2200
   m_RootOrder: 0
2201 2201
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
2202 2202
   m_AnchorMin: {x: 0, y: 0}
2203
-  m_AnchorMax: {x: 1, y: 1}
2203
+  m_AnchorMax: {x: 0, y: 0}
2204 2204
   m_AnchoredPosition: {x: 0, y: 0}
2205 2205
   m_SizeDelta: {x: 20, y: 20}
2206 2206
   m_Pivot: {x: 0.5, y: 0.5}
@@ -2999,6 +2999,7 @@ GameObject:
2999 2999
   - component: {fileID: 4729699525819985522}
3000 3000
   - component: {fileID: 8860455315290877675}
3001 3001
   - component: {fileID: 5820508368243838493}
3002
+  - component: {fileID: 919599457488568932}
3002 3003
   m_Layer: 5
3003 3004
   m_Name: Console
3004 3005
   m_TagString: Untagged
@@ -3077,6 +3078,26 @@ MonoBehaviour:
3077 3078
   m_logItem: {fileID: 4986082269114511332}
3078 3079
   m_logInfoText: {fileID: 158377702976253081}
3079 3080
   m_logInfoContent: {fileID: 4712303639915398071}
3081
+--- !u!114 &919599457488568932
3082
+MonoBehaviour:
3083
+  m_ObjectHideFlags: 0
3084
+  m_CorrespondingSourceObject: {fileID: 0}
3085
+  m_PrefabInstance: {fileID: 0}
3086
+  m_PrefabAsset: {fileID: 0}
3087
+  m_GameObject: {fileID: 7901705949282892813}
3088
+  m_Enabled: 1
3089
+  m_EditorHideFlags: 0
3090
+  m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
3091
+  m_Name: 
3092
+  m_EditorClassIdentifier: 
3093
+  m_IgnoreLayout: 0
3094
+  m_MinWidth: -1
3095
+  m_MinHeight: -1
3096
+  m_PreferredWidth: -1
3097
+  m_PreferredHeight: -1
3098
+  m_FlexibleWidth: 1
3099
+  m_FlexibleHeight: 1
3100
+  m_LayoutPriority: 1
3080 3101
 --- !u!1 &8049699809490860672
3081 3102
 GameObject:
3082 3103
   m_ObjectHideFlags: 0
@@ -3241,7 +3262,7 @@ GameObject:
3241 3262
   m_Icon: {fileID: 0}
3242 3263
   m_NavMeshLayer: 0
3243 3264
   m_StaticEditorFlags: 0
3244
-  m_IsActive: 0
3265
+  m_IsActive: 1
3245 3266
 --- !u!224 &7222317201223020142
3246 3267
 RectTransform:
3247 3268
   m_ObjectHideFlags: 0

+ 6 - 6
Resources/UI/DebugPanel.prefab

@@ -133,7 +133,7 @@ MonoBehaviour:
133 133
   m_EditorClassIdentifier: 
134 134
   m_IgnoreLayout: 0
135 135
   m_MinWidth: -1
136
-  m_MinHeight: -1
136
+  m_MinHeight: 80
137 137
   m_PreferredWidth: -1
138 138
   m_PreferredHeight: 100
139 139
   m_FlexibleWidth: -1
@@ -333,7 +333,7 @@ RectTransform:
333 333
   m_RootOrder: 0
334 334
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
335 335
   m_AnchorMin: {x: 0, y: 0}
336
-  m_AnchorMax: {x: 1, y: 1}
336
+  m_AnchorMax: {x: 0, y: 0}
337 337
   m_AnchoredPosition: {x: 0, y: 0}
338 338
   m_SizeDelta: {x: 0, y: 0}
339 339
   m_Pivot: {x: 0.5, y: 0.5}
@@ -387,7 +387,7 @@ MonoBehaviour:
387 387
   m_Script: {fileID: 11500000, guid: 86710e43de46f6f4bac7c8e50813a599, type: 3}
388 388
   m_Name: 
389 389
   m_EditorClassIdentifier: 
390
-  m_AspectMode: 1
390
+  m_AspectMode: 3
391 391
   m_AspectRatio: 1.7777778
392 392
 --- !u!1 &1987371793023134104
393 393
 GameObject:
@@ -501,10 +501,10 @@ RectTransform:
501 501
   m_Father: {fileID: 1987371792633695863}
502 502
   m_RootOrder: 0
503 503
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
504
-  m_AnchorMin: {x: 0, y: 0}
505
-  m_AnchorMax: {x: 1, y: 1}
504
+  m_AnchorMin: {x: 0, y: 0.5}
505
+  m_AnchorMax: {x: 1, y: 0.5}
506 506
   m_AnchoredPosition: {x: 0, y: 0}
507
-  m_SizeDelta: {x: 0, y: 0}
507
+  m_SizeDelta: {x: 0, y: 1080}
508 508
   m_Pivot: {x: 0.5, y: 0.5}
509 509
 --- !u!114 &1987371793039076130
510 510
 MonoBehaviour:

+ 5 - 5
Runtime/Scripts/Resource/LoadResHandle.cs

@@ -34,14 +34,14 @@ namespace TFramework
34 34
         /// <summary>
35 35
         /// ¼ÓÔØÍê³Éʼþ
36 36
         /// </summary>
37
-        public TFuncAsync<T,bool> OnLoadOver;
37
+        public TAction<T> OnLoadOver;
38 38
 
39 39
         public LoadResHandle()
40 40
         {
41 41
 
42 42
         }
43 43
 
44
-        public LoadResHandle(ResLoadMode resLoadMode, string resourePath, string assetbundleName, string assetPath, TAction<float> onLoading = null, TFuncAsync<T, bool> onLoadOver = null)
44
+        public LoadResHandle(ResLoadMode resLoadMode, string resourePath, string assetbundleName, string assetPath, TAction<float> onLoading = null, TAction<T> onLoadOver = null)
45 45
         {
46 46
             LoadMode = resLoadMode;
47 47
             ResourcePath = resourePath;
@@ -57,7 +57,7 @@ namespace TFramework
57 57
         /// <param name="resourePath"></param>
58 58
         /// <param name="onLoading"></param>
59 59
         /// <param name="onLoadOver"></param>
60
-        public LoadResHandle(string resourePath, TAction<float> onLoading = null, TFuncAsync<T, bool> onLoadOver = null)
60
+        public LoadResHandle(string resourePath, TAction<float> onLoading = null, TAction<T> onLoadOver = null)
61 61
         {
62 62
             LoadMode = ResLoadMode.Resourece;
63 63
             ResourcePath = resourePath;
@@ -73,7 +73,7 @@ namespace TFramework
73 73
         /// <param name="assetPath"></param>
74 74
         /// <param name="onLoading"></param>
75 75
         /// <param name="onLoadOver"></param>
76
-        public LoadResHandle(string assetbundleName, string assetPath, TAction<float> onLoading = null, TFuncAsync<T, bool> onLoadOver = null)
76
+        public LoadResHandle(string assetbundleName, string assetPath, TAction<float> onLoading = null, TAction<T> onLoadOver = null)
77 77
         {
78 78
             LoadMode = ResLoadMode.AssetBundle;
79 79
             AssetBundleName = assetbundleName;
@@ -82,7 +82,7 @@ namespace TFramework
82 82
             OnLoadOver = onLoadOver;
83 83
         }
84 84
 
85
-        public LoadResHandle(UIResourceAttribute attribute, TAction<float> onLoading = null, TFuncAsync<T, bool> onLoadOver = null)
85
+        public LoadResHandle(UIResourceAttribute attribute, TAction<float> onLoading = null, TAction<T> onLoadOver = null)
86 86
         {
87 87
             LoadMode = attribute.LoadMode;
88 88
             ResourcePath = attribute.ResourcePath;

+ 6 - 13
Runtime/Scripts/Resource/ResourceManager.cs

@@ -189,7 +189,7 @@ namespace TFramework
189 189
         /// <param name="onLoading">加载中事件</param>
190 190
         /// <param name="onLoadDone">加载完成事件</param>
191 191
         /// <returns></returns>
192
-        public async UniTask<Scene> LoadSceneAsync(string scenePath, TAction<float> OnLoading, TFuncAsync<Scene, bool> OnLoadOver, LoadSceneMode loadSceneMode = LoadSceneMode.Single)
192
+        public async UniTask<Scene> LoadSceneAsync(string scenePath, TAction<float> OnLoading, TAction<Scene> OnLoadOver, LoadSceneMode loadSceneMode = LoadSceneMode.Single)
193 193
         {
194 194
            return  await LoadScene(scenePath, ResLoadMode.Resourece, "", OnLoading, OnLoadOver, loadSceneMode);
195 195
         }
@@ -207,7 +207,7 @@ namespace TFramework
207 207
             return await LoadScene(resHandle.AssetPath,resHandle.LoadMode,resHandle.AssetBundleName,resHandle.OnLoading,resHandle.OnLoadOver, loadSceneMode);
208 208
         }
209 209
 
210
-        private async UniTask<Scene> LoadScene(string scenePath, ResLoadMode loadMode ,string assetBundleName ,TAction<float> OnLoading,TFuncAsync<Scene, bool> OnLoadOver, LoadSceneMode loadSceneMode)
210
+        private async UniTask<Scene> LoadScene(string scenePath, ResLoadMode loadMode ,string assetBundleName ,TAction<float> OnLoading,TAction<Scene> OnLoadOver, LoadSceneMode loadSceneMode)
211 211
         {
212 212
             if (SceneManager.GetSceneByPath(scenePath) == CurrentScene)
213 213
             {
@@ -249,19 +249,12 @@ namespace TFramework
249 249
                 await UniTask.Yield();
250 250
             }
251 251
             Debug.Log($"加载场景{scenePath}完成");
252
-            OnLoading?.Invoke(1);
253
-            if(OnLoadOver != null)
254
-            {
255
-                if (await OnLoadOver.Invoke(SceneManager.GetSceneByPath(scenePath)))
256
-                {
257
-                    ao.allowSceneActivation = true;
258
-                }
259
-            }
260
-            else
261
-                ao.allowSceneActivation = true;
252
+           
253
+           ao.allowSceneActivation = true;
262 254
 
263 255
             await ao.ToUniTask();
264
-
256
+            OnLoading?.Invoke(1);
257
+            OnLoadOver?.Invoke(SceneManager.GetSceneByPath(scenePath));
265 258
             SceneManager.SetActiveScene(SceneManager.GetSceneByPath(scenePath));
266 259
             CurrentScene = SceneManager.GetActiveScene();
267 260
             return CurrentScene;