|
1 |
| -using System.Collections; |
2 |
| -using System.Collections.Generic; |
3 |
| -using UnityEngine; |
4 |
| -//========================================================================================================================================================================== |
5 |
| -/* ,------. ,---. ,--------.,--. ,--. ,----. ,------.,--. ,--.,------.,------. ,---. ,--------. ,-----. ,------. |
6 |
| - | .--. ' / O \'--. .--'| '--' | ' .-./ | .---'| ,'.| || .---'| .--. ' / O \'--. .--'' .-. '| .--. ' |
7 |
| - | '--' || .-. | | | | .--. | | | .---.| `--, | |' ' || `--, | '--'.'| .-. | | | | | | || '--'.' |
8 |
| - | | --' | | | | | | | | | | ' '--' || `---.| | ` || `---.| |\ \ | | | | | | ' '-' '| |\ \ |
9 |
| - `--' `--' `--' `--' `--' `--' `------' `------'`--' `--'`------'`--' '--'`--' `--' `--' `-----' `--' '--' */ |
10 |
| -//========================================================================================================================================================================= |
| 1 | +//========================================================================================================================================== |
| 2 | +// ,------. ,---. ,--------.,--. ,--. ,----. ,------.,--. ,--.,------.,------. ,---. ,--------. ,-----. ,------. |
| 3 | +// | .--. ' / O \'--. .--'| '--' | ' .-./ | .---'| ,'.| || .---'| .--. ' / O \'--. .--'' .-. '| .--. ' |
| 4 | +// | '--' || .-. | | | | .--. | | | .---.| `--, | |' ' || `--, | '--'.'| .-. | | | | | | || '--'.' |
| 5 | +// | | --' | | | | | | | | | | ' '--' || `---.| | ` || `---.| |\ \ | | | | | | ' '-' '| |\ \ |
| 6 | +// `--' `--' `--' `--' `--' `--' `------' `------'`--' `--'`------'`--' '--'`--' `--' `--' `-----' `--' '--' |
| 7 | +//========================================================================================================================================= |
11 | 8 | //
|
12 | 9 | // PATH GENERATOR GUI LANGUAGE CLASS
|
13 | 10 | //
|
14 | 11 | // GUI language management class
|
15 | 12 | // GUI 언어 관리 클래스
|
16 | 13 | //
|
17 |
| -//------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
18 |
| -// 2022.11.29 _ KimYC1223 |
19 |
| -//========================================================================================================================================================================= |
20 |
| -namespace CurvedPathGenertator { |
| 14 | +//----------------------------------------------------------------------------------------------------------------------------------------- |
| 15 | +// 2022.11.04 _ KimYC1223 |
| 16 | +//========================================================================================================================================= |
| 17 | +using System.Collections.Generic; |
21 | 18 |
|
22 |
| - //===================================================================================================================================================================== |
| 19 | +namespace CurvedPathGenertator |
| 20 | +{ |
| 21 | + //===================================================================================================================================== |
23 | 22 | // Supported languages | Chinese support coming soon
|
24 | 23 | // 지원되는 언어 | 중국어 지원 추가 예정
|
25 |
| - //===================================================================================================================================================================== |
26 |
| - public enum LANGUAGE { ENG, KOR, JAP }; |
27 |
| - |
28 |
| - public class PathGeneratorGUILanguage { |
| 24 | + //===================================================================================================================================== |
| 25 | + /// <summary> |
| 26 | + /// Supported languages |
| 27 | + /// </summary> |
| 28 | + public enum LANGUAGE |
| 29 | + { ENG, KOR, JAP }; |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// PATH GENERATOR GUI LANGUAGE CLASS |
| 33 | + /// </summary> |
| 34 | + public class PathGeneratorGUILanguage |
| 35 | + { |
| 36 | + /// <summary> |
| 37 | + /// currently set language |
| 38 | + /// </summary> |
29 | 39 | public static LANGUAGE CurrentLanguage = LANGUAGE.ENG;
|
30 | 40 |
|
31 |
| - static Dictionary<string, string> ENG_TEXT; |
32 |
| - static Dictionary<string, string> KOR_TEXT; |
33 |
| - static Dictionary<string, string> JAP_TEXT; |
| 41 | + /// <summary> |
| 42 | + /// english text key-value dictionary |
| 43 | + /// </summary> |
| 44 | + private static Dictionary<string, string> ENG_TEXT; |
34 | 45 |
|
35 |
| - //================================================================================================================================================================= |
| 46 | + /// <summary> |
| 47 | + /// Korean text key-value dictionary |
| 48 | + /// </summary> |
| 49 | + private static Dictionary<string, string> KOR_TEXT; |
| 50 | + |
| 51 | + /// <summary> |
| 52 | + /// Japanese text key-value dictionary |
| 53 | + /// </summary> |
| 54 | + private static Dictionary<string, string> JAP_TEXT; |
| 55 | + |
| 56 | + //================================================================================================================================= |
36 | 57 | // Init Localization method
|
37 |
| - //----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 58 | + //--------------------------------------------------------------------------------------------------------------------------------- |
38 | 59 | // Initialize language-specific Dictionary variables
|
39 | 60 | // 언어별 Dictionary 변수 초기화
|
40 |
| - //================================================================================================================================================================= |
41 |
| - static public void InitLocalization() { |
| 61 | + //================================================================================================================================= |
| 62 | + /// <summary> |
| 63 | + /// Initialize language-specific Dictionary variables |
| 64 | + /// </summary> |
| 65 | + public static void InitLocalization() |
| 66 | + { |
42 | 67 | string key_text;
|
43 |
| - if (ENG_TEXT != null && KOR_TEXT != null && JAP_TEXT != null) |
| 68 | + if ( ENG_TEXT != null && KOR_TEXT != null && JAP_TEXT != null ) |
44 | 69 | return;
|
45 | 70 |
|
46 | 71 | ENG_TEXT = new Dictionary<string, string>();
|
47 | 72 | KOR_TEXT = new Dictionary<string, string>();
|
48 | 73 | JAP_TEXT = new Dictionary<string, string>();
|
49 | 74 |
|
50 |
| - //============================================================================================================================================================= |
| 75 | + //============================================================================================================================= |
51 | 76 | // [PG] Path Generator GUI text settings
|
52 | 77 | // [PG] Path Generator GUI 텍스트 설정
|
53 |
| - //============================================================================================================================================================= |
| 78 | + //============================================================================================================================= |
54 | 79 | key_text = "PG_Title";
|
55 | 80 | ENG_TEXT.Add(key_text, "Curved Path Generator");
|
56 | 81 | KOR_TEXT.Add(key_text, "곡선 경로 생성기");
|
@@ -107,9 +132,9 @@ static public void InitLocalization() {
|
107 | 132 | JAP_TEXT.Add(key_text, "エディタ関連");
|
108 | 133 |
|
109 | 134 | key_text = "PG_PathTypeChangeButton_isLivePathWarning";
|
110 |
| - ENG_TEXT.Add(key_text, "Updates the path every frame. Therefore, even if the node or angle changes position at runtime,"+ |
| 135 | + ENG_TEXT.Add(key_text, "Updates the path every frame. Therefore, even if the node or angle changes position at runtime," + |
111 | 136 | "it is applied to the path immediately. However, the amount of calculation may increase.");
|
112 |
| - KOR_TEXT.Add(key_text, "매 프레임마다 경로를 업데이트 합니다. 따라서, 런타임에서 Node나 Angle의 위치가 바뀌어도"+ |
| 137 | + KOR_TEXT.Add(key_text, "매 프레임마다 경로를 업데이트 합니다. 따라서, 런타임에서 Node나 Angle의 위치가 바뀌어도" + |
113 | 138 | "즉시 경로에 적용됩니다. 다만 계산량이 많아 질 수 있습니다.");
|
114 | 139 | JAP_TEXT.Add(key_text, "フレームごとにパスを更新します。 したがって、ランタイムでノードやアングルの" +
|
115 | 140 | "位置が変わっても直ちに経路に適用されます。 ただし、計算量が多くなる可能性があります。");
|
@@ -349,10 +374,10 @@ static public void InitLocalization() {
|
349 | 374 | KOR_TEXT.Add(key_text, "렌더 큐의 기본값은 3000입니다.");
|
350 | 375 | JAP_TEXT.Add(key_text, "レンダリング キューのデフォルト値は 3000 です。");
|
351 | 376 |
|
352 |
| - //============================================================================================================================================================= |
| 377 | + //============================================================================================================================= |
353 | 378 | // [PF] Path Follower GUI text settings
|
354 | 379 | // [PF] Path Follower GUI 텍스트 설정
|
355 |
| - //============================================================================================================================================================= |
| 380 | + //============================================================================================================================= |
356 | 381 | key_text = "PF_Title";
|
357 | 382 | ENG_TEXT.Add(key_text, "Curved Path Follower");
|
358 | 383 | KOR_TEXT.Add(key_text, "곡선 경로 팔로워");
|
@@ -424,21 +449,30 @@ static public void InitLocalization() {
|
424 | 449 | JAP_TEXT.Add(key_text, "メソッドを実行");
|
425 | 450 | }
|
426 | 451 |
|
427 |
| - //================================================================================================================================================================= |
| 452 | + //================================================================================================================================= |
428 | 453 | // Get Local Text
|
429 |
| - //----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 454 | + //--------------------------------------------------------------------------------------------------------------------------------- |
430 | 455 | // Text output corresponding to the set language
|
431 | 456 | // 설정된 언어에 해당하는 텍스트 출력
|
432 |
| - //================================================================================================================================================================= |
433 |
| - static public string GetLocalText(string key_text) { |
434 |
| - try{ |
435 |
| - if (CurrentLanguage == LANGUAGE.KOR) |
| 457 | + //================================================================================================================================= |
| 458 | + /// <summary> |
| 459 | + /// Text output corresponding to the set language |
| 460 | + /// </summary> |
| 461 | + /// <param name="key_text">text key</param> |
| 462 | + /// <returns>translated text</returns> |
| 463 | + public static string GetLocalText(string key_text) |
| 464 | + { |
| 465 | + try |
| 466 | + { |
| 467 | + if ( CurrentLanguage == LANGUAGE.KOR ) |
436 | 468 | return KOR_TEXT[key_text];
|
437 |
| - else if (CurrentLanguage == LANGUAGE.JAP) |
| 469 | + else if ( CurrentLanguage == LANGUAGE.JAP ) |
438 | 470 | return JAP_TEXT[key_text];
|
439 | 471 | else
|
440 | 472 | return ENG_TEXT[key_text];
|
441 |
| - } catch (System.Exception e) { |
| 473 | + } |
| 474 | + catch ( System.Exception e ) |
| 475 | + { |
442 | 476 | e.ToString();
|
443 | 477 | return "";
|
444 | 478 | }
|
|
0 commit comments