public void InitLocaleManager(string defaultLang = "en") { TextAsset[] tas = Resources.LoadAll <TextAsset>(path); foreach (TextAsset t in tas) { LocaleModel locale = JsonUtility.FromJson <LocaleModel>(t.text); _data[locale.lang] = locale; } DefaultLang = defaultLang; Assert.If(!_data.ContainsKey(DefaultLang), $"Locale: can't find {DefaultLang}"); SelectedLang = new WObservable <string>(DefaultLang); }
public InterpolationBase(Timing timing, T f, T t, bool autoPlay = false) { Percent = new WObservable <int>(0); Time = new WObservable <float>(0f); _timing = timing; _from = f; _to = t; if (autoPlay) { Start(); } }
public void InitObject(CavEngine engine) { Engine = engine; Observable = new WObservable <SenderEv>(null); var components = GetComponentsInChildren <WGMComponent>(true); // init them all foreach (WGMComponent c in components) { c.InitComponent(this); _components[c.Id] = c; } // start foreach (var kv in _components) { kv.Value.StartComponent(); } }