Skip to content

Commit 791e431

Browse files
committed
fix: Use action instead delegate
1 parent 65ac577 commit 791e431

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Assets/JCSUnity/Scripts/Managers/JCS_AppManager.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* $Notice: See LICENSE.txt for modification and distribution information
77
* Copyright (c) 2015 by Shen, Jen-Chieh $
88
*/
9+
using System;
910
using System.Collections;
1011
using System.Collections.Generic;
1112
using UnityEngine;
@@ -17,8 +18,6 @@
1718

1819
namespace JCSUnity
1920
{
20-
public delegate void OnSystemLanguageChanged(SystemLanguage language);
21-
2221
/// <summary>
2322
/// Manager manage application layer.
2423
/// </summary>
@@ -31,7 +30,7 @@ public class JCS_AppManager : JCS_Manager<JCS_AppManager>
3130
public static bool APP_INITIALIZING = true;
3231

3332
// Execute after the system language has changed.
34-
public OnSystemLanguageChanged onSystemLanguageChanged = null;
33+
public Action<SystemLanguage> onSystemLanguageChanged = null;
3534

3635
[Separator("Check Variables (JCS_AppManager)")]
3736

@@ -97,8 +96,7 @@ public SystemLanguage systemLanguage
9796
this.mSystemLanguage = value;
9897
RefreshLangTexts();
9998

100-
if (onSystemLanguageChanged != null)
101-
onSystemLanguageChanged.Invoke(value);
99+
onSystemLanguageChanged?.Invoke(value);
102100
}
103101
}
104102
public bool SimulateSystemLanguage { get { return this.mSimulateSystemLanguage; } set { this.mSimulateSystemLanguage = value; } }

0 commit comments

Comments
 (0)