Exemple #1
0
 private void OnUnloadScene(int lastId, int nextId)
 {
     FXManager.Instance.DeleteFXs();
     FXPool.Instance.Clear();
     MonsterPool.Instance.Clear();
     PetPool.Instance.Clear();
     PlayerPool.Instance.Clear();
     CityPlayerPool.Instance.Clear();
     AvatarPool.Instance.Clear();
     ModelPool.Instance.Clear();
     NPCPool.Instance.Clear();
     GameObjectLoader.Instance.Clear();
     CityMonsterPool.Instance.Clear();
     FXSpineManager.Instance.DeleteAllSpine();
     FXSpinePool.Instance.Clear();
     AssetManager.AssetOfSpineManager.Clear();
     AssetManager.AssetOfControllerManager.Clear();
     AudioAssetPool.ClearAll();
     AssetManager.ClearEquipCustomizationAssets();
     AssetManager.AssetOfTPManager.ReleaseNoRef();
     AssetManager.ReleaseNoRef(false);
     GC.Collect();
     ActorVisibleManager.Instance.ClearAVC();
     TransactionNPCManager.Instance.Clear();
 }
Exemple #2
0
    public static AudioAssetData GetAudioAssetNow(int templateId)
    {
        if (AudioAssetPool.mAudioClipCache.ContainsKey(templateId))
        {
            return(AudioAssetPool.mAudioClipCache.get_Item(templateId));
        }
        Audio audio = DataReader <Audio> .Get(templateId);

        string path = AudioAssetPool.GetPath(audio, templateId);

        if (string.IsNullOrEmpty(path))
        {
            return(null);
        }
        if (!AudioAssetPool.mAudioClipPaths.Contains(path))
        {
            AudioAssetPool.mAudioClipPaths.Add(path);
        }
        AudioClip iClip = AssetManager.AssetOfNoPool.LoadAssetNow(path, typeof(Object)) as AudioClip;

        return(AudioAssetPool.PushToPool(templateId, iClip, audio.mode == 1, audio.volumeSize));
    }
Exemple #3
0
    public void PlayBGMByID(int templateId)
    {
        if (!this.IsBGMOn())
        {
            return;
        }
        if (this.mBGMSource == null || this.mBGMSource.get_mute())
        {
            return;
        }
        if (templateId <= 0)
        {
            return;
        }
        AudioAssetData audioAssetNow = AudioAssetPool.GetAudioAssetNow(templateId);

        if (audioAssetNow != null)
        {
            this.bgmVolumeScale = audioAssetNow.volumeScale;
            this.currentBGVolum = this.bgmVolumeScale;
            this.PlayBGM(audioAssetNow.audio, 0.8f, null);
        }
    }
Exemple #4
0
    public static void LoadAudioAsset(int templateId, Action <bool> finish_callback)
    {
        if (AudioAssetPool.mAudioClipCache.ContainsKey(templateId) && AudioAssetPool.mAudioClipCache.get_Item(templateId) != null)
        {
            if (finish_callback != null)
            {
                finish_callback.Invoke(true);
            }
            return;
        }
        Audio dataAudio = DataReader <Audio> .Get(templateId);

        string path = AudioAssetPool.GetPath(dataAudio, templateId);

        if (string.IsNullOrEmpty(path))
        {
            if (finish_callback != null)
            {
                finish_callback.Invoke(false);
            }
            return;
        }
        AssetManager.AssetOfNoPool.LoadAsset(path, typeof(Object), delegate(Object obj)
        {
            if (!AudioAssetPool.mAudioClipPaths.Contains(path))
            {
                AudioAssetPool.mAudioClipPaths.Add(path);
            }
            AudioClip iClip = obj as AudioClip;
            AudioAssetPool.PushToPool(templateId, iClip, dataAudio.mode == 1, dataAudio.volumeSize);
            if (finish_callback != null)
            {
                finish_callback.Invoke(true);
            }
        });
    }