找回密碼
 注冊帳號

掃一掃,訪問微社區

camera.backgroundcolor 背景顏色

2015-1-4 01:27| 發布者: 楊炎| 查看: 2700| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: camera.backgroundcolor 背景顏色varbackgroundcolor:colordescription描述the color with which the screen will be cleared.屏幕將被清理為這個顏色。only used ifclearflagsare set tocameraclearflags.solidcolo ...

camera.backgroundcolor 背景顏色

varbackgroundcolor:color

description描述

the color with which the screen will be cleared.

屏幕將被清理為這個顏色。

only used ifclearflagsare set tocameraclearflags.solidcolor(orcameraclearflags.skyboxbut the skybox is not set up).

只在clearflags被設置為cameraclearflags.solidcolor(或者設置為cameraclearflags.skybox但是沒有設置天空盒)。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

publiccolorcolor1 =color.red;

publiccolorcolor2 =color.blue;

public float duration = 3.0f;

void update() {

float t =mathf.pingpong(time.time, duration) / duration;

camera.backgroundcolor =color.lerp(color1, color2, t);

}

public void awake() {

camera.clearflags =cameraclearflags.solidcolor;

}

}

// 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);

}

參見:camera.clearflags屬性.

相關閱讀

文章點評
相關文章
女校游泳队彩金