Unity物体材质属性Offset动态偏移

Unity物体材质属性Offset动态偏移

cpp 复制代码
  MeshRenderer mr;
    float offset;
    public float scrollSpeed = 0.5F;
    private void Start()
    {
        mr = GetComponent<MeshRenderer>();
    }
    void Update()
    {
        offset = -Time.time * scrollSpeed;
        mr.material.mainTextureOffset = new Vector2(0, -offset);
    }
相关推荐
AllBlue6 小时前
unity嵌入安卓界面,如何显示状态
android·unity·游戏引擎
丫丫7237347 小时前
Three.js 材质系统总结笔记
javascript·笔记·材质
tealcwu7 小时前
【Unity技巧】实现在Play时自动保存当前场景
java·unity·游戏引擎
tealcwu8 小时前
【Unity基础】实现Scroll View跟随动态内容滚动
java·unity·游戏引擎
野奔在山外的猫9 小时前
【文档】VSCode 配置 Unity 环境流程
unity
技术小甜甜10 小时前
[Godot排错] 上传 Google Play Console 封闭测试时签名证书不匹配错误的解决方案
游戏引擎·godot·游戏开发
变身缎带18 小时前
Unity中的NetworkManager基于protobuf, Socket-TCP
tcp/ip·unity·游戏引擎
AllBlue1 天前
unity调用安卓方法
android·unity·游戏引擎
郝学胜-神的一滴1 天前
Horse3D游戏引擎研发笔记(十):在QtOpenGL环境下,视图矩阵与投影矩阵(摄像机)带你正式进入三维世界
c++·3d·unity·游戏引擎·godot·图形渲染·unreal engine
AllBlue1 天前
unity导出成安卓工程,集成到安卓显示
android·unity·游戏引擎