LocalizationのStringTableが見つかりません。
LocalizedStringTableが通っているのに、なぜStringTableがひっかかるのでしょうか。
もしご存知でしたらご教授ください。
-エラー内容
error CS0246: The type or namespace name 'StringTable' could not be found (are you missing a using directive or an assembly reference?)
-Unity 2020.3.21f1
-Localization Version 1.0.5
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4using UnityEngine.Localization; 5 6public class LocalizedStringTableExample : MonoBehaviour 7{ 8 public LocalizedStringTable m_StringTable = new LocalizedStringTable{ TableReference = "My Strings" }; 9 10 string m_TranslatedStringHello; 11 string m_TranslatedStringGoodbye; 12 string m_TranslatedStringThisIsATest; 13 14 void OnEnable() 15 { 16 m_StringTable.RegisterChangeHandler(LoadStrings); 17 } 18 19 void OnDisable() 20 { 21 m_StringTable.ClearChangeHandler(); 22 } 23 24 void LoadStrings(StringTable stringTable) 25 { 26 m_TranslatedStringHello = GetLocalizedString(stringTable, "Hello"); 27 m_TranslatedStringGoodbye = GetLocalizedString(stringTable, "Goodbye"); 28 m_TranslatedStringThisIsATest = GetLocalizedString(stringTable, "This is a test"); 29 } 30 31 static string GetLocalizedString(StringTable table, string entryName) 32 { 33 var entry = table.GetEntry(entryName); 34 return entry.GetLocalizedString(); // We can pass in optional arguments for Smart Format or String.Format here. 35 } 36 37 void OnGUI() 38 { 39 if (!LocalizationSettings.InitializationOperation.IsDone) 40 { 41 GUILayout.Label("Initializing Localization"); 42 return; 43 } 44 45 GUILayout.Label(m_TranslatedStringThisIsATest); 46 GUILayout.Label(m_TranslatedStringHello); 47 GUILayout.Label(m_TranslatedStringGoodbye); 48 } 49}
あなたの回答
tips
プレビュー