找回密碼
 注冊帳號

掃一掃,訪問微社區

color32.lerp 插值

2015-1-5 01:27| 發布者: 楊炎| 查看: 2171| 評論: 0|原作者: 蠻牛|來自: unity3d腳本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);

}

相關閱讀

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