Example #1
0
 public void Stop()
 {
     if (!this.hasStream)
     {
         return;
     }
     this.Transparency = 0f;
     MovieMaterial.CloseStream(this.m_nativeContext);
     this.m_hasFinished = true;
     this.hasStream     = false;
     SoundLib.StopMovieMusic(this.movieKey, false);
 }
Example #2
0
    private IEnumerator OnFinishedLoadFile_delay(DataSerializerErrorCode errNo, Int32 slotID, Int32 saveID, Boolean isSuccess)
    {
        Single remainTime = Mathf.Max(2f - (Time.time - this.timeCounter), 0f);

        yield return(new WaitForSeconds(remainTime));

        this.progressBar.value = 1f;
        yield return(new WaitForSeconds(0.1f));

        this.LoadingAccessPanel.SetActive(false);
        if (isSuccess && errNo == DataSerializerErrorCode.Success)
        {
            FF9Sfx.FF9SFX_Play(1261);
            this.Hide(delegate
            {
                SoundLib.StopMovieMusic("FMV000", true);
                this.Loading = true;
                FF9StateSystem.Settings.SetSound();
                FF9StateSystem.Settings.SetSoundEffect();
                EventEngine instance = PersistenSingleton <EventEngine> .Instance;
                instance.ReplaceLoadMap();
                PersistenSingleton <UIManager> .Instance.TitleScene.SplashScreenEnabled = true;
                AchievementManager.ResyncNormalAchievements();
                FF9StateSystem.Settings.UpdateSetting();
                ff9.w_frameNewSession();
                SceneDirector.FadeEventSetColor(FadeMode.Sub, Color.white);
            });
        }
        else
        {
            FF9Sfx.FF9SFX_Play(1046);
            FF9UIDataTool.DisplayTextLocalize(this.HelpTitleLabel, "SaveHelpBlock");
            global::Debug.LogError("Cannot load file");
            this.DisplayCorruptAccessDialog(SaveLoadUI.FileGroupButton, SaveLoadUI.SerializeType.Load, errNo);
            this.isFileCorrupt[saveID] = true;
            this.DisplayFileInfo(this.currentFile, (SharedDataPreviewSlot)null);
        }
        yield break;
    }
Example #3
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 #4
0
 public void Update()
 {
     if (this.m_nativeContext != IntPtr.Zero && !this.m_hasFinished)
     {
         IntPtr nativeTextureContext = MovieMaterial.GetNativeTextureContext(this.m_nativeContext);
         if (nativeTextureContext != this.m_nativeTextureContext)
         {
             this.DestroyTextures();
             this.AllocateTexures();
             this.m_nativeTextureContext = nativeTextureContext;
         }
         this.m_hasFinished = MovieMaterial.HasFinished(this.m_nativeContext);
         if (!this.m_hasFinished)
         {
             if (this.advance)
             {
                 double elapsedTime = this.m_elapsedTime;
                 float  num         = Mathf.Max(this.playSpeed, 0f);
                 bool   flag        = false;
                 flag |= this.isFMV;
                 if (flag)
                 {
                     if (this.preciseTimeCycleCounter == 0)
                     {
                         this.m_elapsedTime += 0.066 * (double)this.playSpeed;
                     }
                     else
                     {
                         this.m_elapsedTime += 0.067 * (double)this.playSpeed;
                     }
                     if (this.preciseTimeCycleCounter == 2)
                     {
                         this.preciseTimeCycleCounter = 0;
                     }
                     else
                     {
                         this.preciseTimeCycleCounter++;
                     }
                 }
                 else
                 {
                     this.m_elapsedTime += (double)(Mathf.Min(Time.deltaTime, 0.067f) * num);
                 }
                 if (this.shouldSync)
                 {
                     SoundLib.SeekMovieAudio(this.movieKey, this.PlayPosition);
                     this.shouldSync = false;
                 }
                 if (this.playSpeed > 1f)
                 {
                     this.syncElapsed += Time.deltaTime;
                     if (this.syncElapsed >= 4f)
                     {
                         SoundLib.SeekMovieAudio(this.movieKey, this.PlayPosition);
                         this.syncElapsed = 0f;
                     }
                 }
             }
         }
         else
         {
             if (this.loopCount - 1 <= 0 && this.loopCount != -1)
             {
                 SoundLib.StopMovieMusic(this.movieKey, false);
                 if (this.OnFinished != null)
                 {
                     this.m_elapsedTime = MovieMaterial.GetDecodedFrameTime(this.m_nativeContext);
                     this.OnFinished();
                 }
                 return;
             }
             if (this.loopCount != -1)
             {
                 this.loopCount--;
             }
             this.m_elapsedTime %= MovieMaterial.GetDecodedFrameTime(this.m_nativeContext);
             MovieMaterial.Seek(this.m_nativeContext, 0.0, false);
             this.m_hasFinished = false;
         }
         MovieMaterial.SetTargetDisplayDecodeTime(this.m_nativeContext, this.m_elapsedTime);
         if (!this.getFirstFrame)
         {
             double uploadedFrameTime = MovieMaterial.GetUploadedFrameTime(this.m_nativeContext);
             double num2 = 0.066666666666666666;
             if (uploadedFrameTime > num2)
             {
                 this.m_elapsedTime           = 0.0;
                 this.preciseTimeCycleCounter = 0;
                 this.getFirstFrame           = true;
                 if (this.Material != null)
                 {
                     this.Material.SetColor("_TintColor", this.tintColor);
                 }
                 if (this.advance)
                 {
                     SoundLib.PlayMovieMusic(this.movieKey, 0);
                 }
             }
         }
     }
 }