IEnumerator Thread_FadeOutUpdateVolume( TPCode t ) { //先等資料設定完成 yield return null; AudioMute am = ( AudioMute ) t.DataObject; yield return t.FloatLerp( am.volume, thisAudio.volume, 0.0f, am.time ); t.DataObject = null; }
IEnumerator Thread_Recycle( TPCode t ) { //先等資料設定完成 yield return null; AudioLife al = ( AudioLife ) t.DataObject; yield return t.Idle( al.time ); al.auds.clip = null; Vault.RecycleGameObject( al.go ); }
IEnumerator Thread_FadeOut( TPCode t ) { //先等資料設定完成 yield return null; AudioMute am = ( AudioMute ) t.DataObject; TPCode muv = null; am.TPObj.NewThread( Thread_FadeOutUpdateVolume, ref muv ); muv.DataObject = t.DataObject; while ( muv.DataObject != null ) { if ( !am.Source.gameObject.activeSelf ) yield break; am.Source.volume = am.volume[ 0 ]; yield return null; } am.Source.Stop(); if ( am.NewClipIndex >= 0 ) Play( am.NewClipIndex, am.bNewLoop ); }