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

スクリプト言語

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

Light.range

Switch to Manual
public var range: float;

Description

ライトの大きさを設定する。

See Also: Light component.

	// Pulse light's range between original range
	// and half of the original one
	
	var duration : float = 3.0;
	private var originalRange : float;
	originalRange = light.range;
	
	function Update() {
		var amplitude : float = Mathf.PingPong( Time.time, duration );
		// transform from 0..duration to 0.5..1 range
		amplitude = amplitude / duration * 0.5 + 0.5;
		// set light range
		light.range = originalRange * amplitude;
	}