Skip to content

Commit 7709280

Browse files
committed
feat: Improve canvas callback's args
1 parent 438a9ae commit 7709280

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Assets/JCSUnity/Scripts/UI/JCS_Canvas.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ public enum ShowMethod
3838
public Action doHide = null;
3939

4040
// Execution when canvas is shown.
41-
public Action<JCS_Canvas> onShow = null;
41+
public Action<bool> onShow = null;
4242
// Execution when canvas is hidden.
43-
public Action<JCS_Canvas> onHide = null;
43+
public Action<bool> onHide = null;
4444

4545
// Execution when canvas is shown by fading.
46-
public Action<JCS_Canvas> onShowFade = null;
46+
public Action onShowFade = null;
4747
// Execution when canvas is hidden by fading.
48-
public Action<JCS_Canvas> onHideFade = null;
48+
public Action onHideFade = null;
4949

5050
private RectTransform mAppRect = null; // Application Rect (Window)
5151

@@ -329,7 +329,7 @@ public void Show(bool mute = false)
329329

330330
doShow?.Invoke();
331331

332-
onShow?.Invoke(this);
332+
onShow?.Invoke(mute);
333333
}
334334

335335
#region Show
@@ -373,7 +373,7 @@ public void Hide(bool mute = false)
373373

374374
doHide?.Invoke();
375375

376-
onHide?.Invoke(this);
376+
onHide?.Invoke(mute);
377377
}
378378

379379
#region Hide
@@ -496,7 +496,7 @@ private void DoFading()
496496
{
497497
mCanvasGroup.alpha = mFadeInAmount;
498498

499-
onShowFade?.Invoke(this);
499+
onShowFade?.Invoke();
500500
}
501501
break;
502502
case JCS_FadeType.OUT:
@@ -505,7 +505,7 @@ private void DoFading()
505505

506506
mCanvas.enabled = false;
507507

508-
onHideFade?.Invoke(this);
508+
onHideFade?.Invoke();
509509
}
510510
break;
511511
}

Assets/JCSUnity/Scripts/UI/JCS_CanvasComp.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ public Action doHide
3737
get => mCanvas.doHide;
3838
set => mCanvas.doHide = value;
3939
}
40-
public Action<JCS_Canvas> onShow
40+
public Action<bool> onShow
4141
{
4242
get => mCanvas.onShow;
4343
set => mCanvas.onShow = value;
4444
}
45-
public Action<JCS_Canvas> onHide
45+
public Action<bool> onHide
4646
{
4747
get => mCanvas.onHide;
4848
set => mCanvas.onHide = value;
4949
}
50-
public Action<JCS_Canvas> onShowFade
50+
public Action onShowFade
5151
{
5252
get => mCanvas.onShowFade;
5353
set => mCanvas.onShowFade = value;
5454
}
55-
public Action<JCS_Canvas> onHideFade
55+
public Action onHideFade
5656
{
5757
get => mCanvas.onHideFade;
5858
set => mCanvas.onHideFade = value;

0 commit comments

Comments
 (0)