Skip to content

Commit 506a780

Browse files
committed
Moved to Unity 6000.0.8f1
1 parent 06e35f8 commit 506a780

10 files changed

Lines changed: 2068 additions & 79 deletions

File tree

Assets/DFT_Games/Localization/Scripts/Locale.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ public static class Locale
1414
public static Dictionary<string, string> CurrentLanguageStrings = new Dictionary<string, string>();
1515
static TextAsset currentLocalizationText;
1616

17+
public delegate void OnLanguageChangedDelegate();
18+
public static event OnLanguageChangedDelegate OnLanguageChanged;
19+
20+
21+
1722
/// <summary>
1823
/// This sets the current language. It expects a standard .Net CultureInfo.Name format
1924
/// </summary>
@@ -51,6 +56,7 @@ public static string CurrentLanguage
5156
{
5257
Debug.LogErrorFormat("Locale Language '{0}' not found!", currentLanguage);
5358
}
59+
OnLanguageChanged?.Invoke();
5460
}
5561
}
5662
}

Assets/DFT_Games/Localization/Scripts/LocalizeBase.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public abstract class LocalizeBase : MonoBehaviour
3434

3535
#region Public Properties
3636

37-
3837
#endregion Public Properties
3938

4039
#region Private Properties
@@ -59,6 +58,17 @@ protected virtual void Start()
5958
SetCurrentLanguage(Locale.PlayerLanguage);
6059
}
6160
UpdateLocale();
61+
Locale.OnLanguageChanged += UpdateLocale;
62+
}
63+
64+
private void OnDestroy()
65+
{
66+
Locale.OnLanguageChanged -= UpdateLocale;
67+
}
68+
69+
private void OnEnable()
70+
{
71+
UpdateLocale();
6272
}
6373

6474
/// <summary>
@@ -82,15 +92,6 @@ public static void SetCurrentLanguage(SystemLanguage language)
8292
{
8393
Locale.CurrentLanguage = language.ToString();
8494
Locale.PlayerLanguage = language;
85-
Localize[] allTexts = GameObject.FindObjectsByType<Localize>(FindObjectsSortMode.None);
86-
LocalizeTM[] allTextsTM = GameObject.FindObjectsByType<LocalizeTM>(FindObjectsSortMode.None);
87-
LocalizeImage[] allImages = GameObject.FindObjectsByType<LocalizeImage>(FindObjectsSortMode.None);
88-
for (int i = 0; i < allImages.Length; i++)
89-
allImages[i].UpdateLocale();
90-
for (int i = 0; i < allTexts.Length; i++)
91-
allTexts[i].UpdateLocale();
92-
for (int i = 0; i < allTextsTM.Length; i++)
93-
allTextsTM[i].UpdateLocale();
9495
}
9596

9697

Logs/Packages-Update.log

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,13 @@ The following packages were updated:
8686
com.unity.ugui from version 1.0.0 to 2.0.0
8787
The following packages were removed:
8888
com.unity.textmeshpro@3.0.6
89+
90+
=== Sat Jun 29 14:37:42 2024
91+
92+
Packages were changed.
93+
Update Mode: updateDependencies
94+
95+
The following packages were updated:
96+
com.unity.test-framework from version 1.3.9 to 1.4.4
97+
com.unity.timeline from version 1.8.6 to 1.8.7
98+
com.unity.toolchain.win-x86_64-linux-x86_64 from version 2.0.6 to 2.0.9

Packages/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"com.unity.2d.tilemap": "1.0.0",
55
"com.unity.ai.navigation": "2.0.0",
66
"com.unity.ide.visualstudio": "2.0.22",
7-
"com.unity.test-framework": "1.3.9",
8-
"com.unity.timeline": "1.8.6",
9-
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.6",
7+
"com.unity.test-framework": "1.4.4",
8+
"com.unity.timeline": "1.8.7",
9+
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9",
1010
"com.unity.ugui": "2.0.0",
1111
"com.unity.xr.legacyinputhelpers": "2.1.10",
1212
"com.unity.modules.accessibility": "1.0.0",

Packages/packages-lock.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@
4747
"url": "https://packages.unity.com"
4848
},
4949
"com.unity.sysroot": {
50-
"version": "2.0.7",
50+
"version": "2.0.10",
5151
"depth": 1,
5252
"source": "registry",
5353
"dependencies": {},
5454
"url": "https://packages.unity.com"
5555
},
5656
"com.unity.sysroot.linux-x86_64": {
57-
"version": "2.0.6",
57+
"version": "2.0.9",
5858
"depth": 1,
5959
"source": "registry",
6060
"dependencies": {
61-
"com.unity.sysroot": "2.0.7"
61+
"com.unity.sysroot": "2.0.10"
6262
},
6363
"url": "https://packages.unity.com"
6464
},
6565
"com.unity.test-framework": {
66-
"version": "1.3.9",
66+
"version": "1.4.4",
6767
"depth": 0,
6868
"source": "registry",
6969
"dependencies": {
@@ -74,7 +74,7 @@
7474
"url": "https://packages.unity.com"
7575
},
7676
"com.unity.timeline": {
77-
"version": "1.8.6",
77+
"version": "1.8.7",
7878
"depth": 0,
7979
"source": "registry",
8080
"dependencies": {
@@ -86,12 +86,12 @@
8686
"url": "https://packages.unity.com"
8787
},
8888
"com.unity.toolchain.win-x86_64-linux-x86_64": {
89-
"version": "2.0.6",
89+
"version": "2.0.9",
9090
"depth": 0,
9191
"source": "registry",
9292
"dependencies": {
93-
"com.unity.sysroot": "2.0.7",
94-
"com.unity.sysroot.linux-x86_64": "2.0.6"
93+
"com.unity.sysroot": "2.0.10",
94+
"com.unity.sysroot.linux-x86_64": "2.0.9"
9595
},
9696
"url": "https://packages.unity.com"
9797
},

0 commit comments

Comments
 (0)