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

スクリプト言語

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

Camera.backgroundColor

Switch to Manual
public var backgroundColor: Color;

Description

The color with which the screen will be cleared.

Only used if clearFlags are set to CameraClearFlags.SolidColor (or CameraClearFlags.Skybox but the skybox is not set up).

	// ping-pong animate background color
	var color1 : Color = Color.red;
	var color2 : Color = Color.blue;
	var duration = 3.0;
	
	// Set clear flags to color
	camera.clearFlags = CameraClearFlags.SolidColor;
	
	function Update () {
		var t : float = Mathf.PingPong (Time.time, duration) / duration;
		camera.backgroundColor = Color.Lerp (color1, color2, t);
	}