开启辅助访问
 找回密码
 注册帐号

扫一扫,访问微社区

camera.backgroundcolor 背景颜色

2015-1-4 01:27| 发布者: 杨炎| 查看: 1534| 评论: 0|原作者: 蛮牛|来自:

摘要 : 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属性.

0 0 0 0 0

相关阅读

最新评论

返回顶部