Skip to content

Commit 920549e

Browse files
committed
日本語化
1 parent 30b7547 commit 920549e

9 files changed

Lines changed: 346 additions & 32 deletions

EVMC4U/CameraReceiver.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,28 @@ namespace EVMC4U
3838
public class CameraReceiver : MonoBehaviour, IExternalReceiver
3939
{
4040
[Header("CameraReceiver v1.1")]
41+
[SerializeField, Label("VMCカメラ制御同期Camera")]
4142
public Camera VMCControlledCamera = null; //VMCカメラ制御同期
42-
[SerializeField]
43+
[SerializeField, Label("動作状況")]
4344
private string StatusMessage = ""; //Inspector表示用
4445

46+
#if EVMC4U_JA
47+
[Header("カメラ手ブレ補正フィルタ")]
48+
#else
4549
[Header("Lowpass Filter Option")]
50+
#endif
51+
[SerializeField, Label("カメラ位置フィルタ(手ブレ補正)")]
4652
public bool CameraPositionFilterEnable = false; //カメラ位置フィルタ(手ブレ補正)
53+
[SerializeField, Label("カメラ回転フィルタ(手ブレ補正)")]
4754
public bool CameraRotationFilterEnable = false; //カメラ回転フィルタ(手ブレ補正)
55+
[SerializeField, Label("カメラフィルタ係数")]
4856
public float CameraFilter = 0.95f; //カメラフィルタ係数
4957

58+
#if EVMC4U_JA
59+
[Header("デイジーチェーン")]
60+
#else
5061
[Header("Daisy Chain")]
62+
#endif
5163
public GameObject[] NextReceivers = new GameObject[1];
5264

5365
private ExternalReceiverManager externalReceiverManager = null;

EVMC4U/CommunicationValidator.cs

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,35 +38,69 @@ namespace EVMC4U
3838
public class CommunicationValidator : MonoBehaviour, IExternalReceiver
3939
{
4040
[Header("CommunicationValidator v1.2")]
41-
[SerializeField]
41+
[SerializeField, Label("動作状況")]
4242
private string StatusMessage = ""; //Inspector表示用
4343

44+
#if EVMC4U_JA
45+
[Header("UI オプション")]
46+
#else
4447
[Header("UI Option")]
48+
#endif
49+
[SerializeField, Label("画面上に表示する")]
4550
public bool ShowInformation = false;
4651

47-
[Header("Status Monitor")]
48-
[SerializeField]
52+
#if EVMC4U_JA
53+
[Header("状態モニタ(表示用)")]
54+
#else
55+
[Header("Status Monitor(Read only)")]
56+
#endif
57+
[SerializeField, Label("受信処理再帰呼出し回数")]
4958
private int CallCountMonitor = 0; //Inspector表示用
5059

60+
[SerializeField, Label("利用可能")]
5161
public int Available = 0;
62+
[SerializeField, Label("送信側Time")]
5263
public float time = 0;
5364

65+
[SerializeField, Label("キャリブレーション状態")]
5466
public CalibrationState calibrationState = 0;
67+
[SerializeField, Label("キャリブレーションモード")]
5568
public CalibrationMode calibrationMode = 0;
5669

70+
#if EVMC4U_JA
71+
[Header("送信側受信状態(表示用)")]
72+
#else
5773
[Header("Receive Status(Read only)")]
74+
#endif
75+
[SerializeField, Label("受信許可")]
5876
public bool ReceiveEnable = false;
77+
[SerializeField, Label("受信ポート")]
5978
public int ReceivePort = 0;
79+
[SerializeField, Label("読み込み済み設定ファイルパス")]
6080
public string LoadedConfigPath = "";
81+
[SerializeField, Label("背景色")]
6182
public Color backgroundColor = Color.clear;
83+
84+
#if EVMC4U_JA
85+
[Header("送信側ウィンドウ属性情報")]
86+
#else
6287
[Header("Window Attribute Info(Read only)")]
88+
#endif
89+
[SerializeField, Label("最前面")]
6390
public bool IsTopMost = false;
91+
[SerializeField, Label("透過")]
6492
public bool IsTransparent = false;
93+
[SerializeField, Label("クリックスルー")]
6594
public bool WindowClickThrough = false;
95+
[SerializeField, Label("枠なし")]
6696
public bool HideBorder = false;
6797

6898

99+
#if EVMC4U_JA
100+
[Header("デイジーチェーン")]
101+
#else
69102
[Header("Daisy Chain")]
103+
#endif
70104
public GameObject[] NextReceivers = new GameObject[1];
71105

72106
private ExternalReceiverManager externalReceiverManager = null;

EVMC4U/DeviceReceiver.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,32 @@ public class DeviceReceiver : MonoBehaviour, IExternalReceiver
4040
const int arrayMax = 16;
4141

4242
[Header("DeviceReceiver v1.1")]
43-
[SerializeField]
43+
[SerializeField, Label("動作状況")]
4444
private string StatusMessage = ""; //Inspector表示用
45+
[SerializeField, Label("現実のトラッキング位置を反映")]
4546
public bool RealPosition = false;
4647

47-
[Header("Device Config")]
48+
#if EVMC4U_JA
49+
[Header("トラッキング設定")]
50+
#else
51+
[Header("Tracking Config")]
52+
#endif
4853
public string[] Serials = new string[arrayMax];
4954
public Transform[] Transforms = new Transform[arrayMax];
5055

51-
[Header("Device Monitor")]
56+
#if EVMC4U_JA
57+
[Header("トラッキングデバイス情報モニタ(表示用)")]
58+
#else
59+
[Header("Tracking Device Monitor")]
60+
#endif
5261
public string[] Types = new string[arrayMax];
5362
public Vector3[] Vector3s = new Vector3[arrayMax];
5463

64+
#if EVMC4U_JA
65+
[Header("デイジーチェーン")]
66+
#else
5567
[Header("Daisy Chain")]
68+
#endif
5669
public GameObject[] NextReceivers = new GameObject[1];
5770

5871
private ExternalReceiverManager externalReceiverManager = null;

EVMC4U/DirectionalLightReceiver.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,16 @@ namespace EVMC4U
3838
public class DirectionalLightReceiver : MonoBehaviour, IExternalReceiver
3939
{
4040
[Header("DirectionalLightReceiver v1.2")]
41+
[SerializeField, Label("VMCディレクショナルライト制御同期Light")]
4142
public Light VMCControlledLight = null; //VMCディレクショナルライト制御同期
42-
[SerializeField]
43+
[SerializeField, Label("動作状況")]
4344
private string StatusMessage = ""; //Inspector表示用
4445

46+
#if EVMC4U_JA
47+
[Header("デイジーチェーン")]
48+
#else
4549
[Header("Daisy Chain")]
50+
#endif
4651
public GameObject[] NextReceivers = new GameObject[1];
4752

4853
private ExternalReceiverManager externalReceiverManager = null;

EVMC4U/Editor/ExternalReceiverEditor.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ public class ExternalReceiverEditor : Editor
3636
{
3737
public override void OnInspectorGUI()
3838
{
39-
if (GUILayout.Button("Open Manual / 説明書を開く"))
39+
#if EVMC4U_JA
40+
if (GUILayout.Button("説明書を開く"))
4041
{
4142
Tutorial.Open();
4243
}
44+
#else
45+
if (GUILayout.Button("Open Manual"))
46+
{
47+
Tutorial.Open();
48+
}
49+
#endif
4350
base.OnInspectorGUI();
4451
}
4552
}

EVMC4U/Editor/Tutorial.cs

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
using UnityEditor.AnimatedValues;
3535
using UnityEngine.Events;
3636
using VRM;
37+
using System.Linq;
38+
3739
namespace EVMC4U
3840
{
3941
public class Tutorial : EditorWindow
@@ -60,7 +62,8 @@ private class TutorialJson
6062
{
6163
public bool debug;
6264
public TutorialPage[] pages;
63-
public override string ToString() {
65+
public override string ToString()
66+
{
6467
return "TutorialJson debug:" + debug + " pages:" + pages.Length;
6568
}
6669
}
@@ -104,7 +107,8 @@ public override string ToString()
104107
static void InitializeOnLoad()
105108
{
106109
//一度も開いたことない場合は、ここで開く
107-
if (EditorUserSettings.GetConfigValue("Opened") != "1" || (check && EditorUserSettings.GetConfigValue("VRMCheckCaution") != "1")) {
110+
if (EditorUserSettings.GetConfigValue("Opened") != "1" || (check && EditorUserSettings.GetConfigValue("VRMCheckCaution") != "1"))
111+
{
108112
Open();
109113
}
110114
}
@@ -167,7 +171,8 @@ public static void Open()
167171
//一度開いたのを覚えておく
168172
EditorUserSettings.SetConfigValue("Opened", "1");
169173
}
170-
catch (ArgumentException e) {
174+
catch (ArgumentException e)
175+
{
171176
//Debug.LogError(e);
172177
jsonError = e.ToString();
173178
tutorialJson = null;
@@ -179,7 +184,8 @@ public static void Open()
179184
EditorUserSettings.SetConfigValue("VRMCheckCaution", "1");
180185
page = "versionCheckFailed";
181186
}
182-
else {
187+
else
188+
{
183189
EditorUserSettings.SetConfigValue("VRMCheckCaution", "0");
184190
}
185191
}
@@ -194,29 +200,33 @@ public static void ResetLanguage()
194200
void OnGUI()
195201
{
196202
//ページを開いたまま初期化されたら、初期ロード処理に飛ばす
197-
if (page == "") {
203+
if (page == "")
204+
{
198205
GUI.Label(new Rect(10, 10, window_w, window_h), "INVALID STATE\n\nチュートリアルの読み込みに失敗しました。\nUnityPackageの導入からやり直してみてください\n\nTutorial load failed.\nPlease re-import UnityPackage.");
199206
Open();
200207
return;
201208
}
202209

203210
//アニメーションを立ち上げる
204-
if (anim.valueChanged == null) {
211+
if (anim.valueChanged == null)
212+
{
205213
var repaintEvent = new UnityEvent();
206214
repaintEvent.AddListener(() => Repaint());
207215
anim.valueChanged = repaintEvent;
208216
}
209217

210218
//アニメーション折り返し
211-
if (anim.value > anim.target-0.1f) {
219+
if (anim.value > anim.target - 0.1f)
220+
{
212221
anim.target = 0.001f;
213222
}
214223

215224
//ページの表示処理を開始
216225
TutorialPage tutorialPage;
217-
if (!tutorialPages.TryGetValue(page, out tutorialPage)) {
226+
if (!tutorialPages.TryGetValue(page, out tutorialPage))
227+
{
218228
//JSONが多分バグってるときに表示
219-
GUI.Label(new Rect(10, 10, window_w - 20, window_h), "JSON LOAD FAILED\n"+ jsonError + "\n\nチュートリアルの読み込みに失敗しました。\nUnityPackageの導入からやり直してみてください\n\nTutorial load failed.\nPlease re-import UnityPackage.");
229+
GUI.Label(new Rect(10, 10, window_w - 20, window_h), "JSON LOAD FAILED\n" + jsonError + "\n\nチュートリアルの読み込みに失敗しました。\nUnityPackageの導入からやり直してみてください\n\nTutorial load failed.\nPlease re-import UnityPackage.");
220230
if (GUI.Button(new Rect(0, window_h - 30, window_w, 30), "Reload"))
221231
{
222232
Open();
@@ -242,14 +252,16 @@ void OnGUI()
242252
GUI.Label(new Rect(0, 0, window_w, window_h), tutorialPage.text);
243253

244254
//ボタンを1つずつ表示
245-
foreach (var b in tutorialPage.buttons) {
255+
foreach (var b in tutorialPage.buttons)
256+
{
246257
if (tutorialJson.debug)
247258
{
248259
Debug.Log(b);
249260
}
250261

251262
//ボタンに画像があればそれを表示
252-
if (b.image != "") {
263+
if (b.image != "")
264+
{
253265
//画像を読み込む
254266
var texture = Resources.Load<Texture>("tutorial/" + b.image);
255267

@@ -260,7 +272,7 @@ void OnGUI()
260272
b.w = window_w;
261273
}
262274

263-
string buttonName = "btn#" + page + "#" +b.x + "-" + b.y + "-" + b.w + "-" + b.h;
275+
string buttonName = "btn#" + page + "#" + b.x + "-" + b.y + "-" + b.w + "-" + b.h;
264276
float height = b.w * texture.height / texture.width;
265277

266278
Rect r = new Rect(b.x, b.y, b.w, height);
@@ -281,9 +293,11 @@ void OnGUI()
281293
anim.target = 2f;
282294
}
283295
}
284-
else {
296+
else
297+
{
285298
//テキストボタンを表示
286-
if (GUI.Button(new Rect(b.x, b.y, b.w, b.h), b.text)) {
299+
if (GUI.Button(new Rect(b.x, b.y, b.w, b.h), b.text))
300+
{
287301
buttonFireProcess(b.fire);
288302
buttonUriProcess(b.uri);
289303
}
@@ -293,14 +307,15 @@ void OnGUI()
293307
//デバッグ再読み込みボタン
294308
if (tutorialJson.debug)
295309
{
296-
if (GUI.Button(new Rect(0,window_h-30,30,30),"#"))
310+
if (GUI.Button(new Rect(0, window_h - 30, 30, 30), "#"))
297311
{
298312
Open();
299313
}
300314
}
301315
}
302316

303-
void buttonUriProcess(string uri) {
317+
void buttonUriProcess(string uri)
318+
{
304319
if (tutorialJson.debug)
305320
{
306321
Debug.LogWarning("buttonProcess: " + uri);
@@ -320,10 +335,42 @@ void buttonUriProcess(string uri) {
320335
}
321336
}
322337

323-
void buttonFireProcess(string fire) {
324-
switch (fire) {
325-
case "SaveLanguageJa": EditorUserSettings.SetConfigValue("Language", "ja"); break;
326-
case "SaveLanguageEn": EditorUserSettings.SetConfigValue("Language", "en"); break;
338+
void buttonFireProcess(string fire)
339+
{
340+
switch (fire)
341+
{
342+
case "SaveLanguageJa":
343+
{
344+
EditorUserSettings.SetConfigValue("Language", "ja");
345+
var symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone).Split(';').ToList();
346+
if (symbols.Contains("EVMC4U_EN"))
347+
{
348+
symbols.Remove("EVMC4U_EN");
349+
}
350+
if (!symbols.Contains("EVMC4U_JA"))
351+
{
352+
symbols.Add("EVMC4U_JA");
353+
}
354+
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, String.Join(";", symbols.ToArray()));
355+
356+
break;
357+
}
358+
case "SaveLanguageEn":
359+
{
360+
EditorUserSettings.SetConfigValue("Language", "en");
361+
var symbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone).Split(';').ToList();
362+
if (symbols.Contains("EVMC4U_JA"))
363+
{
364+
symbols.Remove("EVMC4U_JA");
365+
}
366+
if (!symbols.Contains("EVMC4U_EN"))
367+
{
368+
symbols.Add("EVMC4U_EN");
369+
}
370+
PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, String.Join(";", symbols.ToArray()));
371+
372+
break;
373+
}
327374
default: break;
328375
}
329376
}

0 commit comments

Comments
 (0)