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

スクリプト言語

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

AudioSource.pitch

Switch to Manual
public var pitch: float;

Description

スローダウン・スピードアップのためのピッチ変化量(デフォルトは1)。

	// Decreases the pitch in the given seconds

	var startingPitch = 4;
	var timeToDecrease = 5;
	@script RequireComponent(AudioSource)
	function Start() {
		audio.pitch = startingPitch;
	}

	function Update() {
		if(audio.pitch > 0)
			audio.pitch -= ((Time.deltaTime * startingPitch) / timeToDecrease);
	}