public void Init(Messenger msg) { this.msg = msg; curLang = -1; mUnloadPrefab = new MUnloadPrefab(); mLoadedPrefab = new MLoadedPrefab(); mUnloadAudio = new MUnloadAudio(); mLoadedAudio = new MLoadedAudio(); mLanguageAssetsLoaded = new MLanguageAssetsLoaded(); mLanguageLoaded = new MLanguageLoaded(); prefabs = new GameObject[prefabKeys.Length]; audioClips = new AudioClip[audioKeys.Length]; prefabRequests = new ResourceRequest[prefabKeys.Length]; audioRequests = new ResourceRequest[audioKeys.Length]; msg.AddListener <MLoadLanguage>(OnLoadLanguage); }
private void OnLoadedLang(MLanguageAssetsLoaded languageAssetsLoaded) { onSwitchedLanguage.Invoke(languageAssetsLoaded.language); }