LoginSignup
11
8

More than 5 years have passed since last update.

UniRxと戯れる #4 WWWでmp3ファイルの読み込み完了を監視する

Last updated at Posted at 2015-05-21

WWWでmp3ファイルを読み込み完了時にAidopClipをAudioSourceにセットする例。

var www = new WWW(fullpath);
var clip = www.audioClip;
clip.ObserveEveryValueChanged(x => x.loadState)
    .Where(x => x == AudioDataLoadState.Loaded)
    .Subscribe(_ => this.GetComponent<AudioSource>().clip = clip);
11
8
13

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
8