打开APP
未登录
开通VIP,畅享免费电子书等14项超值服
开通VIP
首页
好书
留言交流
下载APP
联系客服
Unity3d中点Renderer的一个材质动画
尹亮亮
>《Unity3d》
2015.08.04
关注
using
UnityEngine
;
using
System
.
Collections
;
/*
**************
*
FFWaterFlow
class
.
*
This
class
moves
UV
texture
on
material
.
**************/
public
class
FFWaterFlow
:
MonoBehaviour
{
public
float
m_SpeedU
=
0.1f
;
public
float
m_SpeedV
= -
0.1f
;
//
######################################################################
//
MonoBehaviour
Functions
//
######################################################################
//
Update
is
called
once
per
frame
void
Update
() {
float
newOffsetU
=
Time
.
time
*
m_SpeedU
;
float
newOffsetV
=
Time
.
time
*
m_SpeedV
;
if
(
this
.
GetComponent
<
Renderer
>())
{
GetComponent
<
Renderer
>().
material
.
mainTextureOffset
=
new
Vector2
(
newOffsetU
,
newOffsetV
);
}
}
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报
。
打开APP,阅读全文并永久保存
查看更多类似文章
猜你喜欢
类似文章
【热】
打开小程序,算一算2024你的财运
《UnityAPI.Keyframe关键帧》(Yanlz Unity SteamVR 云技术 5G AI VR云游戏 Keyframe inTangent outTangent 立钻哥哥 OK )
unity3d 纹理动画
JTable之TableCellRenderer
操作符重载笔记 - 生命如此短暂,掌握技艺却要如此长久 - 博客园
韩顺平 java从入门到精通 笔记整理 1
C#(九)基础篇—静态成员与异常处理
更多类似文章 >>
生活服务
热点新闻
留言交流
回顶部
联系我们
分享
收藏
点击这里,查看已保存的文章
导长图
关注
一键复制
下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!
联系客服
微信登录中...
请勿关闭此页面
先别划走!
送你5元优惠券,购买VIP限时立减!
5
元
优惠券
优惠券还有
10:00
过期
马上使用
×