Material mat;

//

float a=0;

//控制闪烁速度

float speed=0.6f;

float b=1;

Update(){

if(a>0.3f){

b=1;

}

if(a<=0f){

b=-1;

}

a += Time.deltaTime * b *speed;

mat.color=new Color(0,0,0,a)//这里new Color(R,G,B,A)  RGB设置颜色,A改变透明度;

}

05-11 22:13