当前位置:网站首页>Unity RawImage背景无缝连接移动
Unity RawImage背景无缝连接移动
2022-04-23 04:41:00 【龙胖胖的博客】
1.首先创建UI RawImage
2.图片设置

3.效果

4.代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FilmMove : MonoBehaviour
{
//速度
public float m_speedmove;
private RawImage m_RawImage;
// Use this for initialization
void Start () {
m_RawImage = this.GetComponent<RawImage>();
}
// Update is called once per frame
void Update () {
float s =this.m_speedmove * Time.deltaTime;
Rect r =this.m_RawImage.uvRect;
//改变x或y,来改变图片的移动方向
r.y += s;
this.m_RawImage.uvRect = r;
}
//上下交替实现无缝连接
// public float m_MoveSpeed = 1;
// // Start is called before the first frame update
// void Start()
// {
//
// }
//
// // Update is called once per frame
// void Update()
// {
// transform.Translate(0,m_MoveSpeed*Time.deltaTime*100,0);
// if (transform.position.y >= 2880)
// {
// transform.localPosition=new Vector3(0,-1915,0);
// }
// }
}
版权声明
本文为[龙胖胖的博客]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qiao2037641855/article/details/115374861
边栏推荐
- Nature medicine reveals individual risk factors of coronary artery disease
- 补:注解(Annotation)
- Small volume Schottky diode compatible with nsr20f30nxt5g
- leetcode007--判断字符串中的括号是否匹配
- 上海航芯技术分享 | ACM32 MCU安全特性概述
- 383. Ransom letter
- Record the blind injection script
- Eksctl deploying AWS eks
- mysql table 中增加列的SQL语句
- Leetcode004 -- Roman numeral to integer
猜你喜欢

Nature medicine reveals individual risk factors of coronary artery disease

第四章 --- 了解标准设备文件、过滤器和管道
![[AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022](/img/b2/269ae2e9be269c2bff73eb1da5b55d.png)
[AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022

Youqilin 22.04 lts version officially released | ukui 3.1 opens a new experience

test

优麒麟 22.04 LTS 版本正式发布 | UKUI 3.1开启全新体验

/etc/bash_ completion. D directory function (the user logs in and executes the script under the directory immediately)

Brushless motor drive scheme based on Infineon MCU GTM module

RC低通滤波器的逆系统

Chapter 4 - understanding standard equipment documents, filters and pipelines
随机推荐
Chapter 4 - understanding standard equipment documents, filters and pipelines
2019 is coming to an end, the longest day.
智能电子秤全国产化电子元件推荐方案
Phishing for NFT
[paper reading] [3D target detection] point transformer
leetcode008--实现strStr()函数
Logger and zap log Library in go language
zynq平台交叉编译器的安装
KVM error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock‘
Leetcode008 -- implement strstr() function
Leetcode002 -- inverts the numeric portion of a signed integer
What is the thirty-six plan
IEEE Transactions on Systems, Man, and Cybernetics: Systems(TSMC)投稿须知
Recommended scheme for national production of electronic components of wireless keyboard
leetcode006--查找字符串数组中的最长公共前缀
Summary of Android development posts I interviewed in those years (attached test questions + answer analysis)
三十六计是什么
win10, mysql-8.0.26-winx64. Zip installation
Microbial neuroimmune axis -- the hope of prevention and treatment of cardiovascular diseases
383. 赎金信