Skip to content

Commit 2cc6ae9

Browse files
committed
! Upload new version v2.0
1 parent df8b6e3 commit 2cc6ae9

61 files changed

Lines changed: 1970 additions & 547 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/LocalizeService.meta

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-9.26 KB
Binary file not shown.

Assets/LocalizeService/Demo/Demo.unity.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,56 @@
1-
using SunCubeStudio.Localization;
1+
using System;
2+
using Localization;
23
using UnityEngine;
34
using UnityEngine.UI;
45

56
// For DEMO VIEW
67
public class LocolizeTest : MonoBehaviour
78
{
8-
public Text CurrentText;
9+
public Toggle Localization1;
10+
public Toggle Localization2;
11+
public Toggle Localization3;
912

1013
private void Start()
1114
{
12-
CurrentText.text = string.Format("Current localization - {0}", LocalizationService.Instance.Localization);
15+
Localization1.onValueChanged.AddListener(OnLocalization1Set);
16+
Localization2.onValueChanged.AddListener(OnLocalization2Set);
17+
Localization3.onValueChanged.AddListener(OnLocalization3Set);
18+
19+
CheckLocalization();
1320
}
1421

15-
public void English()
22+
private void CheckLocalization()
1623
{
17-
LocalizationService.Instance.Localization = "English";
24+
if (LocalizationService.Instance == null) return;
25+
26+
switch (LocalizationService.Instance.Localization)
27+
{
28+
case "Russian":
29+
Localization2.isOn = true;
30+
break;
31+
case "English":
32+
Localization1.isOn = true;
33+
break;
34+
case "French":
35+
Localization3.isOn = true;
36+
break;
37+
}
38+
}
1839

19-
CurrentText.text = string.Format("Current localization {0}",
20-
LocalizationService.Instance.GetTextByKeyWithLocalize("localization1", "English"));
40+
private void OnLocalization1Set(bool value)
41+
{
42+
if (!value) return;
43+
LocalizationService.Instance.Localization = "English";
2144
}
22-
public void Russian()
45+
private void OnLocalization2Set(bool value)
2346
{
47+
if (!value) return;
2448
LocalizationService.Instance.Localization = "Russian";
25-
26-
CurrentText.text = string.Format("Current localization {0}",
27-
LocalizationService.Instance.GetTextByKeyWithLocalize("localization2", "English"));
2849
}
29-
30-
public void French()
50+
private void OnLocalization3Set(bool value)
3151
{
52+
if (!value) return;
3253
LocalizationService.Instance.Localization = "French";
33-
34-
CurrentText.text = string.Format("Current localization {0}",
35-
LocalizationService.Instance.GetTextByKeyWithLocalize("localization3", "English"));
3654
}
3755

3856
}
-28.9 KB
Binary file not shown.

Assets/LocalizeService/Demo/TexturesDemo/France-Flag-icon.png.meta

Lines changed: 0 additions & 56 deletions
This file was deleted.
Binary file not shown.

Assets/LocalizeService/Demo/TexturesDemo/Jarvis-Island-Flag-icon.png.meta

Lines changed: 0 additions & 56 deletions
This file was deleted.
Binary file not shown.

Assets/LocalizeService/Demo/TexturesDemo/MeshTextRender.renderTexture.meta

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)