Skip to content

Commit 1dfda88

Browse files
committed
updated to v2.12.3
1 parent e2badf0 commit 1dfda88

13 files changed

Lines changed: 147 additions & 62 deletions

File tree

Assets/OxGFrame/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# CHANGELOG
22

3+
## [2.12.3] - 2024-12-27
4+
- Added to CoreFrames.SRFrame & CoreFrames.UIFrame:
5+
- Can use CheckHasAnyHidingAllGroups() to replace CheckHasAnyHiding(-1).
6+
- Can use CloseAllForAllGroups() to replace CloseAll(-1).
7+
- Can use CloseAllAndExcludedForAllGroups() to replace CloseAllAndExcluded(-1).
8+
- Can use RevealAllForAllGroups() to replace RevealAll(-1).
9+
- Can use HideAllForAllGroups() to replace HideAll(-1).
10+
- Can use HideAllAndExcludedForAllGroups() to replace HideAllExcluded(-1).
11+
- Modified access modifiers of certain methods.
12+
- Modified CoreFrames.SRFrame & CoreFrames.UIFrame:
13+
- Update the rules for CheckHasAnyHiding(). By default, groupId is set to 0, and -1 indicates that all groupIds should be processed.
14+
- Fixed RevealAll not marking hidden as false.
15+
316
## [2.12.2] - 2024-11-11
417
- Updated UniEvent of UniFramework.
518
- Added constructors in EncryptionServices (Editor).

Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/CPFrame/CPBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private void OnDestroy()
6262

6363
public override void OnCreate() { }
6464

65-
public sealed override void InitFirst()
65+
internal sealed override void InitFirst()
6666
{
6767
base.InitFirst();
6868
}
@@ -77,7 +77,7 @@ protected override void OnFixedUpdate(float dt) { }
7777

7878
protected override void OnLateUpdate(float dt) { }
7979

80-
public sealed override void Display(object obj)
80+
internal sealed override void Display(object obj)
8181
{
8282
this.gameObject.SetActive(true);
8383
this.OnShow();
@@ -133,7 +133,7 @@ protected override void OnShow(object obj) { }
133133
public override void OnReceiveAndRefresh(object obj = null) { }
134134

135135
[System.Obsolete("This is not supported in this class.")]
136-
public sealed override void Hide(bool disabledPreClose = false) { }
136+
internal sealed override void Hide(bool disabledPreClose = false) { }
137137

138138
[System.Obsolete("This is not supported in this class.")]
139139
protected sealed override void CloseSelf() { }

Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/CoreFrames.cs

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ public static class CoreFrames
1717
/// </summary>
1818
internal const int DEFAULT_GROUP_ID = 0;
1919

20+
/// <summary>
21+
/// Do all groups
22+
/// </summary>
23+
internal const int DO_ALL_GROUPS = -1;
24+
2025
/// <summary>
2126
/// User Interface
2227
/// </summary>
@@ -77,19 +82,28 @@ public static bool CheckIsHiding(UIBase uiBase)
7782
return UIManager.GetInstance().CheckIsHiding(uiBase);
7883
}
7984

85+
/// <summary>
86+
/// Default group id is 0, but if you don't want to execute based on the group id and want to do all, can set the group id to -1
87+
/// </summary>
88+
/// <returns></returns>
8089
public static bool CheckHasAnyHiding()
8190
{
82-
return UIManager.GetInstance().CheckHasAnyHiding();
91+
return UIManager.GetInstance().CheckHasAnyHiding(DEFAULT_GROUP_ID);
8392
}
8493

8594
public static bool CheckHasAnyHiding(int groupId)
8695
{
8796
return UIManager.GetInstance().CheckHasAnyHiding(groupId);
8897
}
8998

99+
public static bool CheckHasAnyHidingForAllGroups()
100+
{
101+
return UIManager.GetInstance().CheckHasAnyHiding(DO_ALL_GROUPS);
102+
}
103+
90104
public static int GetStackByStackCount(string canvasName)
91105
{
92-
return UIManager.GetInstance().GetStackByStackCount(0, canvasName);
106+
return UIManager.GetInstance().GetStackByStackCount(DEFAULT_GROUP_ID, canvasName);
93107
}
94108

95109
public static int GetStackByStackCount(int groupId, string canvasName)
@@ -284,6 +298,11 @@ public static void CloseAll(int groupId, bool disabledPreClose = false, bool for
284298
UIManager.GetInstance().CloseAll(groupId, disabledPreClose, forceDestroy, false, withoutAssetNames);
285299
}
286300

301+
public static void CloseAllForAllGroups(bool disabledPreClose = false, bool forceDestroy = false, params string[] withoutAssetNames)
302+
{
303+
UIManager.GetInstance().CloseAll(DO_ALL_GROUPS, disabledPreClose, forceDestroy, false, withoutAssetNames);
304+
}
305+
287306
/// <summary>
288307
/// Default group id is 0, but if you don't want to execute based on the group id and want to do all, can set the group id to -1
289308
/// </summary>
@@ -300,6 +319,11 @@ public static void CloseAllAndExcluded(int groupId, bool disabledPreClose = fals
300319
UIManager.GetInstance().CloseAll(groupId, disabledPreClose, forceDestroy, true, withoutAssetNames);
301320
}
302321

322+
public static void CloseAllAndExcludedForAllGroups(bool disabledPreClose = false, bool forceDestroy = false, params string[] withoutAssetNames)
323+
{
324+
UIManager.GetInstance().CloseAll(DO_ALL_GROUPS, disabledPreClose, forceDestroy, true, withoutAssetNames);
325+
}
326+
303327
/// <summary>
304328
/// Only allow close stack by stack
305329
/// </summary>
@@ -342,6 +366,11 @@ public static void RevealAll(int groupId)
342366
{
343367
UIManager.GetInstance().RevealAll(groupId);
344368
}
369+
370+
public static void RevealAllForAllGroups()
371+
{
372+
UIManager.GetInstance().RevealAll(DO_ALL_GROUPS);
373+
}
345374
#endregion
346375

347376
#region Hide
@@ -364,6 +393,11 @@ public static void HideAll(int groupId, params string[] withoutAssetNames)
364393
UIManager.GetInstance().HideAll(groupId, false, withoutAssetNames);
365394
}
366395

396+
public static void HideAllForAllGroups(params string[] withoutAssetNames)
397+
{
398+
UIManager.GetInstance().HideAll(DO_ALL_GROUPS, false, withoutAssetNames);
399+
}
400+
367401
/// <summary>
368402
/// Default group id is 0, but if you don't want to execute based on the group id and want to do all, can set the group id to -1
369403
/// </summary>
@@ -377,6 +411,11 @@ public static void HideAllAndExcluded(int groupId, params string[] withoutAssetN
377411
{
378412
UIManager.GetInstance().HideAll(groupId, true, withoutAssetNames);
379413
}
414+
415+
public static void HideAllAndExcludedForAllGroups(params string[] withoutAssetNames)
416+
{
417+
UIManager.GetInstance().HideAll(DO_ALL_GROUPS, true, withoutAssetNames);
418+
}
380419
#endregion
381420
}
382421

@@ -431,16 +470,25 @@ public static bool CheckIsHiding(SRBase srBase)
431470
return SRManager.GetInstance().CheckIsHiding(srBase);
432471
}
433472

473+
/// <summary>
474+
/// Default group id is 0, but if you don't want to execute based on the group id and want to do all, can set the group id to -1
475+
/// </summary>
476+
/// <returns></returns>
434477
public static bool CheckHasAnyHiding()
435478
{
436-
return SRManager.GetInstance().CheckHasAnyHiding();
479+
return SRManager.GetInstance().CheckHasAnyHiding(DEFAULT_GROUP_ID);
437480
}
438481

439482
public static bool CheckHasAnyHiding(int groupId)
440483
{
441484
return SRManager.GetInstance().CheckHasAnyHiding(groupId);
442485
}
443486

487+
public static bool CheckHasAnyHidingForAllGroups()
488+
{
489+
return SRManager.GetInstance().CheckHasAnyHiding(DO_ALL_GROUPS);
490+
}
491+
444492
/// <summary>
445493
/// Send refresh message to specific with data
446494
/// </summary>
@@ -616,6 +664,11 @@ public static void CloseAll(int groupId, bool disabledPreClose = false, bool for
616664
SRManager.GetInstance().CloseAll(groupId, disabledPreClose, forceDestroy, false, withoutAssetNames);
617665
}
618666

667+
public static void CloseAllForAllGroups(bool disabledPreClose = false, bool forceDestroy = false, params string[] withoutAssetNames)
668+
{
669+
SRManager.GetInstance().CloseAll(DO_ALL_GROUPS, disabledPreClose, forceDestroy, false, withoutAssetNames);
670+
}
671+
619672
/// <summary>
620673
/// Default group id is 0, but if you don't want to execute based on the group id and want to do all, can set the group id to -1
621674
/// </summary>
@@ -631,6 +684,11 @@ public static void CloseAllAndExcluded(int groupId, bool disabledPreClose = fals
631684
{
632685
SRManager.GetInstance().CloseAll(groupId, disabledPreClose, forceDestroy, true, withoutAssetNames);
633686
}
687+
688+
public static void CloseAllAndExcludedForAllGroups(bool disabledPreClose = false, bool forceDestroy = false, params string[] withoutAssetNames)
689+
{
690+
SRManager.GetInstance().CloseAll(DO_ALL_GROUPS, disabledPreClose, forceDestroy, true, withoutAssetNames);
691+
}
634692
#endregion
635693

636694
#region Reveal
@@ -651,6 +709,11 @@ public static void RevealAll(int groupId)
651709
{
652710
SRManager.GetInstance().RevealAll(groupId);
653711
}
712+
713+
public static void RevealAllForAllGroups()
714+
{
715+
SRManager.GetInstance().RevealAll(DO_ALL_GROUPS);
716+
}
654717
#endregion
655718

656719
#region Hide
@@ -674,6 +737,11 @@ public static void HideAll(int groupId, params string[] withoutAssetNames)
674737
SRManager.GetInstance().HideAll(groupId, false, withoutAssetNames);
675738
}
676739

740+
public static void HideAllForAllGroups(params string[] withoutAssetNames)
741+
{
742+
SRManager.GetInstance().HideAll(DO_ALL_GROUPS, false, withoutAssetNames);
743+
}
744+
677745
/// <summary>
678746
/// Default group id is 0, but if you don't want to execute based on the group id and want to do all, can set the group id to -1
679747
/// </summary>
@@ -687,6 +755,11 @@ public static void HideAllAndExcluded(int groupId, params string[] withoutAssetN
687755
{
688756
SRManager.GetInstance().HideAll(groupId, true, withoutAssetNames);
689757
}
758+
759+
public static void HideAllAndExcludedForAllGroups(params string[] withoutAssetNames)
760+
{
761+
SRManager.GetInstance().HideAll(DO_ALL_GROUPS, true, withoutAssetNames);
762+
}
690763
#endregion
691764
}
692765

Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/Implement/FrameBase.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private void OnValidate()
149149
/// <summary>
150150
/// 綁定與初次初始
151151
/// </summary>
152-
public virtual void InitFirst()
152+
internal virtual void InitFirst()
153153
{
154154
// 未綁定的話就執行綁定流程
155155
if (!this._isBinded)
@@ -171,7 +171,7 @@ public virtual void InitFirst()
171171
/// 預初始
172172
/// </summary>
173173
/// <returns></returns>
174-
public async UniTask PreInit()
174+
internal async UniTask PreInit()
175175
{
176176
// 等待異步加載, 進行異步加載動作
177177
await this.OnPreShow();
@@ -202,12 +202,12 @@ protected virtual void OnAutoBind() { }
202202
/// 顯示相關流程
203203
/// </summary>
204204
/// <param name="obj"></param>
205-
public abstract void Display(object obj);
205+
internal abstract void Display(object obj);
206206

207207
/// <summary>
208208
/// 隱藏相關流程
209209
/// </summary>
210-
public abstract void Hide(bool disabledPreClose);
210+
internal abstract void Hide(bool disabledPreClose);
211211

212212
/// <summary>
213213
/// 開啟時每次都會被呼叫
@@ -268,7 +268,7 @@ public virtual void OnRelease() { }
268268
/// 設置名稱
269269
/// </summary>
270270
/// <param name="assetName"></param>
271-
public void SetNames(string assetName)
271+
internal void SetNames(string assetName)
272272
{
273273
this.assetName = assetName;
274274
}
@@ -277,7 +277,7 @@ public void SetNames(string assetName)
277277
/// 設置群組 Id
278278
/// </summary>
279279
/// <param name="groupId"></param>
280-
public void SetGroupId(int groupId)
280+
internal void SetGroupId(int groupId)
281281
{
282282
this.groupId = groupId;
283283
}
@@ -286,7 +286,7 @@ public void SetGroupId(int groupId)
286286
/// 設置隱藏開關
287287
/// </summary>
288288
/// <param name="isHidden"></param>
289-
public void SetHidden(bool isHidden)
289+
internal void SetHidden(bool isHidden)
290290
{
291291
this.isHidden = isHidden;
292292
}

Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/Implement/FrameManager.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -324,22 +324,10 @@ public bool CheckHasAnyHiding(int groupId)
324324
{
325325
foreach (var fBase in this._dictAllCache.Values)
326326
{
327-
if (fBase.Peek().groupId == groupId && fBase.Peek().isHidden) return true;
328-
}
329-
330-
return false;
331-
}
332-
333-
/// <summary>
334-
/// 判斷是否有任一隱藏
335-
/// </summary>
336-
/// <param name="id"></param>
337-
/// <returns></returns>
338-
public bool CheckHasAnyHiding()
339-
{
340-
foreach (var fBase in this._dictAllCache.Values)
341-
{
342-
if (fBase.Peek().isHidden) return true;
327+
if (groupId == -1 && fBase.Peek().isHidden)
328+
return true;
329+
else if (fBase.Peek().groupId == groupId && fBase.Peek().isHidden)
330+
return true;
343331
}
344332

345333
return false;

Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/SRFrame/SRBase.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class SRBase : FrameBase
1010

1111
public override void OnCreate() { }
1212

13-
public sealed override void InitFirst()
13+
internal sealed override void InitFirst()
1414
{
1515
base.InitFirst();
1616
}
@@ -31,15 +31,20 @@ protected override void OnFixedUpdate(float dt) { }
3131

3232
protected override void OnLateUpdate(float dt) { }
3333

34-
public sealed override void Display(object obj)
34+
internal sealed override void Display(object obj)
3535
{
3636
this.gameObject.SetActive(true);
3737

38-
if (!this.isHidden) this.OnShow(obj);
39-
else this.OnReveal();
38+
if (!this.isHidden)
39+
this.OnShow(obj);
40+
else
41+
{
42+
this.OnReveal();
43+
this.SetHidden(false);
44+
}
4045
}
4146

42-
public sealed override void Hide(bool disabledPreClose = false)
47+
internal sealed override void Hide(bool disabledPreClose = false)
4348
{
4449
if (!this.gameObject.activeSelf) return;
4550

Assets/OxGFrame/CoreFrame/Scripts/Runtime/Core/SRFrame/SRManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ public override void HideAll(int groupId, bool forceHideExcluded = false, params
347347
#region 顯示場景 & 關閉場景
348348
protected async UniTask LoadAndDisplay(SRBase srBase, object obj = null)
349349
{
350-
if (!srBase.isHidden) await srBase.PreInit();
350+
if (!srBase.isHidden)
351+
await srBase.PreInit();
351352
srBase.Display(obj);
352353
}
353354

0 commit comments

Comments
 (0)