言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

AudioListener.pause

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Switch to Manual
public static var pause: bool;
public static bool pause;
public static pause as bool

Description

オーディオの停止状態

もしtrueに設定した場合、全てのAudioSourcesが再生を一時停止します。これはエディタ上でゲームの一時再生ボタンと同じ動作をします。一時停止状態はtrueですがAudioSettings.dspTimeは凍結させ、進めるためにAudioSourceの再生は一時停止でも動くようになります。もし一時停止中に確実に音を再生させたい場合は、AudioSourceのignoreListenerPauseをtrue似設定する必要があります。これは一般的にはメニューのメニューアイテムの音や背景音楽に使用します。三秒後に再生する音を入れ、オーディオシステムを1秒停止させた後、スケジュールされた音は一時亭を解除して2秒後に再生されるので時間が凍結します。

	AudioListener.pause = true;
using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    void Example() {
        AudioListener.pause = true;
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Example() as void:
		AudioListener.pause = true