color32.lerp 插值

2015-1-5 01:27| 发布者: 杨炎| 查看: 2057| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本manual

摘要: color32.lerp 插值static functionlerp(a: color32,b: color32,t: float) : color32description描述interpolates between colors a and b by t.在颜色a和b之间通过t插值。/t/ is clamped between 0 and 1. when t is ...

color32.lerp 插值

static functionlerp(a: color32,b: color32,t: float) : color32

description描述

interpolates between colors a and b by t.

颜色a和b之间通过t插值。

/t/ is clamped between 0 and 1. when t is 0 returns a. when t is 1 returns b.

t被钳制在0到1之间。当t为0时返回a;当t为1是返回b。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public color32 colorwhite =color.white;

public color32 colorblack =color.black;

public color32 lerpedcolor =color.white;

void update() {

lerpedcolor = color32.lerp(colorwhite, colorblack, time.time);

}

}

// converts a white color to a black one trough time.

//经过一段时间转换白色到黑色

var colorwhite : color32 =color.white;

var colorblack : color32 =color.black;

var lerpedcolor : color32 =color.white;

function update() {

lerpedcolor = color32.lerp(colorwhite, colorblack, time.time);

}

相关阅读

文章点评
相关文章