技术栈

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

Ke-Di2024-06-12 22:34

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);
    }
上一篇:React hooks动态配置侧边栏
下一篇:leetcode刷题记录37-2476. 二叉搜索树最近节点查询
相关推荐
魔士于安
4 小时前
unity 音乐会场景 unity2022
游戏·unity·游戏引擎·贴图·模型
一线灵
5 小时前
Axmol 3.x 输入系统重构:从 Touch/Mouse 到统一 Pointer,再到现代 InputField
重构·游戏引擎
Zwarwolf
5 小时前
Godot零散知识点项目汇总
游戏引擎·godot
Mediary
6 小时前
Unity is running with Administrator privileges, which isnot supported...
unity
游乐码
8 小时前
Unity基础(十四)场景异步加载
unity·游戏引擎
mxwin
9 小时前
Unity Shader URP:法线在空间变换上的特殊性
unity·游戏引擎·shader
nnsix
9 小时前
Unity 动态批处理、静态批处理、GPU Instaning、SRP Batcher 笔记
笔记·unity·单一职责原则
charlee44
10 小时前
Unity在安卓端如何调试输出信息
android·unity·adb·游戏引擎·真机调试
TCW1121
11 小时前
Minetest游戏引擎源代码解析
游戏引擎
热门推荐
01HTTP 与 HTTPS 的区别:从原理到实战详解022026 AI 编程工具终极实战指南:Cursor vs Claude Code vs Copilot,开发者该怎么选?03【AI】2026 年具身智能模型和世界模型总结042026年6月AI行业全景:从百模大战到Agent元年,这30天发生了什么?05《置身钉内》原文-可播放阅读06AI科技热点日报 | 2026年6月1日07GitHub 镜像站点08Claude Code、Codex、Cursor三分天下:2026年AI编程Agent生态全景剖析092026 年 AI 编程工具终极横评:Cursor vs Claude Code vs Copilot vs Windsurf10AI一周事件 · 2026-06-03 至 2026-06-09