打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Unity3d中点Renderer的一个材质动画

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(newOffsetUnewOffsetV);
        }
    }  
}

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
《UnityAPI.Keyframe关键帧》(Yanlz Unity SteamVR 云技术 5G AI VR云游戏 Keyframe inTangent outTangent 立钻哥哥 OK )
unity3d 纹理动画
JTable之TableCellRenderer
操作符重载笔记 - 生命如此短暂,掌握技艺却要如此长久 - 博客园
韩顺平 java从入门到精通 笔记整理 1
C#(九)基础篇—静态成员与异常处理
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服