void OnGUI() { if (langPack == null) { langPack = LangSys.DATA; } if (styleBox == null) { InitStyles(); } //Languages scrollPos = GUI.BeginScrollView(new Rect(0f, 0f, position.width, position.height), scrollPos, new Rect(8f, 8f, position.width - 32f, (langPack.keys.Count + 1) * 100f - 20f), false, true); Languages(new Rect(16f, 16f, position.width - 32f, position.height - 80f)); GUI.EndScrollView(); }
void Update() { if (langPack == null) { langPack = LangSys.DATA; } ProceedTask(); if (!langPack.languages.ContainsKey(langPack.mainLang) && langPack.keys.Count > 0) { langPack.mainLang = langPack.keys[0]; SaveChanges(); } if (!langPack.languages.ContainsKey(LangSys.activeLang) && langPack.keys.Count > 0) { LangSys.activeLang = langPack.keys[0]; } }
public static void Preload() { dataCache = DATA; }
void OnEnable() { minSize = new Vector2(400f, 200f); titleContent = new GUIContent("Language Settings"); langPack = LangSys.DATA; }