Example #1
0
        private void ChangeScene()
        {
            Application.LoadLevel("Loading");
            Resources.UnloadUnusedAssets();
            GC.Collect();
            Application.LoadLevel(NextScene);
            SoundLib.StopAllSoundEffects();
            if (CurrentScene != NextScene)
            {
                if (String.Equals(CurrentScene, "QuadMist"))
                {
                    FF9Wipe_FadeInEx(30);
                }
                if (String.Equals(NextScene, "MainMenu"))
                {
                    SoundLib.StopAllSounds();
                }
                if (String.Equals(NextScene, FieldMapSceneName))
                {
                    FF9Snd.sndFuncPtr = FF9Snd.FF9FieldSoundDispatch;
                    if (String.Equals(CurrentScene, WorldMapSceneName))
                    {
                        FF9Snd.HasJustChangedBetweenWorldAndField = true;
                    }
                }
                else if (String.Equals(NextScene, WorldMapSceneName))
                {
                    AllSoundDispatchPlayer soundDispatchPlayer = SoundLib.GetAllSoundDispatchPlayer();
                    soundDispatchPlayer.FF9SOUND_SNDEFFECTRES_STOPCURRENT();
                    HashSet <Int32> exceptObjNo = new HashSet <Int32> {
                        1261
                    };
                    soundDispatchPlayer.FF9SOUND_SNDEFFECT_STOP_ALL(exceptObjNo);
                    soundDispatchPlayer.FF9SOUND_STREAM_STOP();

                    FF9Snd.sndFuncPtr = FF9Snd.FF9WorldSoundDispatch;
                    if (String.Equals(CurrentScene, FieldMapSceneName))
                    {
                        FF9Snd.HasJustChangedBetweenWorldAndField = true;
                    }
                }
                else if (!String.Equals(NextScene, BattleMapSceneName))
                {
                    FF9Snd.sndFuncPtr = !String.Equals(NextScene, "QuadMist") ? FF9Snd.FF9AllSoundDispatch : (FF9Snd.SoundDispatchDelegate)FF9Snd.FF9MiniGameSoundDispatch;
                }
                if (String.IsNullOrEmpty(PendingCurrentScene))
                {
                    LastScene = CurrentScene;
                }
                else
                {
                    LastScene           = PendingCurrentScene;
                    PendingCurrentScene = String.Empty;
                }
                CurrentScene = NextScene;
                UnityEngine.Debug.Log("---------- Current Scene : " + Instance.CurrentScene + " ----------");
            }
            NextScene = String.Empty;
            SetTargetFrameRateForCurrentScene();
        }
Example #2
0
 public void StopActiveSound()
 {
     if (this.activeSound.SoundProfileType == SoundProfileType.Music)
     {
         SoundLib.StopMusic();
         this.IsPlay = false;
     }
     else if (this.activeSound.SoundProfileType == SoundProfileType.SoundEffect)
     {
         SoundLib.StopAllSoundEffects();
     }
     else if (this.activeSound.SoundProfileType == SoundProfileType.Song)
     {
         SoundLib.StopAllSongs();
     }
     else if (this.activeSound.SoundProfileType == SoundProfileType.Sfx)
     {
         SoundLib.StopSfxSound(this.activeSound.SoundIndex);
     }
     else if (this.activeSound.SoundProfileType == SoundProfileType.MovieAudio)
     {
         SoundLib.StopMovieMusic(this.activeSound.Name, true);
     }
 }
Example #3
0
 private void ChangeScene()
 {
     Application.LoadLevel("Loading");
     Resources.UnloadUnusedAssets();
     //GC.Collect();
     LoadNextScene();
     SoundLib.StopAllSoundEffects();
     if (this.CurrentScene != this.NextScene)
     {
         if (String.Equals(this.CurrentScene, "QuadMist"))
         {
             SceneDirector.FF9Wipe_FadeInEx(30);
         }
         if (String.Equals(this.NextScene, "MainMenu"))
         {
             SoundLib.StopAllSounds();
         }
         if (String.Equals(this.NextScene, SceneDirector.FieldMapSceneName))
         {
             FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9FieldSoundDispatch);
             if (String.Equals(this.CurrentScene, SceneDirector.WorldMapSceneName))
             {
                 FF9Snd.HasJustChangedBetweenWorldAndField = true;
             }
         }
         else if (String.Equals(this.NextScene, SceneDirector.WorldMapSceneName))
         {
             AllSoundDispatchPlayer allSoundDispatchPlayer = SoundLib.GetAllSoundDispatchPlayer();
             allSoundDispatchPlayer.FF9SOUND_SNDEFFECTRES_STOPCURRENT();
             allSoundDispatchPlayer.FF9SOUND_SNDEFFECT_STOP_ALL(new HashSet <Int32>
             {
                 1261
             });
             allSoundDispatchPlayer.FF9SOUND_STREAM_STOP();
             FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9WorldSoundDispatch);
             if (String.Equals(this.CurrentScene, SceneDirector.FieldMapSceneName))
             {
                 FF9Snd.HasJustChangedBetweenWorldAndField = true;
             }
         }
         else if (!String.Equals(this.NextScene, SceneDirector.BattleMapSceneName))
         {
             if (String.Equals(this.NextScene, "QuadMist"))
             {
                 FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9MiniGameSoundDispatch);
             }
             else
             {
                 FF9Snd.sndFuncPtr = new FF9Snd.SoundDispatchDelegate(FF9Snd.FF9AllSoundDispatch);
             }
         }
         if (String.IsNullOrEmpty(this.PendingCurrentScene))
         {
             this.LastScene = this.CurrentScene;
         }
         else
         {
             this.LastScene           = this.PendingCurrentScene;
             this.PendingCurrentScene = String.Empty;
         }
         this.CurrentScene = this.NextScene;
         global::Debug.Log("---------- Current Scene : " + PersistenSingleton <SceneDirector> .Instance.CurrentScene + " ----------");
     }
     this.NextScene = String.Empty;
     SceneDirector.SetTargetFrameRateForCurrentScene();
 }