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 OnUnloadPrefab(MUnloadPrefab unload) { onUnloadPrefab.Invoke(unload.prefab, unload.index); }