当前位置:网站首页>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
边栏推荐
- Supplement: Annotation
- Summary of Android development posts I interviewed in those years (attached test questions + answer analysis)
- How to regulate intestinal flora? Introduction to common natural substances, probiotics and prebiotics
- 协程与多进程的完美结合
- IEEE Transactions on systems, man, and Cybernetics: Notes for systems (TSMC)
- [AI vision · quick review of NLP natural language processing papers today, No. 32] wed, 20 APR 2022
- The 14th issue of HMS core discovery reviews the long article | enjoy the silky clip and release the creativity of the video
- 程序员抱怨:1万2的工资我真的活不下去了,网友:我3千咋说
- Leetcode->1 两数之和
- MYSQL查询至少连续n天登录的用户
猜你喜欢
Coinbase:关于跨链桥的基础知识、事实和统计数据
兼容NSR20F30NXT5G的小体积肖特基二极管
Recommended scheme of national manufactured electronic components for intelligent electronic scales
Installation du compilateur croisé de la plateforme zynq
Interaction of diet gut microbiota on cardiovascular disease
Record your own dataset with d435i, run orbslam2 and build a dense point cloud
Recommended scheme of national manufactured electronic components
IDE idea automatic compilation and configuration of on update action and on frame deactivation
Installation of zynq platform cross compiler
第四章 --- 了解标准设备文件、过滤器和管道
随机推荐
递归调用--排列的穷举
1个需求的一生,团队协作在云效钉钉小程序上可以这么玩
leetcode003--判断一个整数是否为回文数
用D435i录制自己的数据集运行ORBslam2并构建稠密点云
【论文阅读】【3d目标检测】Voxel Transformer for 3D Object Detection
Installation and use of Apache bench (AB pressure test tool)
Recommended scheme of national manufactured electronic components
Summary of Android development posts I interviewed in those years (attached test questions + answer analysis)
Ali's ten-year technical experts jointly created the "latest" jetpack compose project combat drill (with demo)
Brushless motor drive scheme based on Infineon MCU GTM module
Bridge between ischemic stroke and intestinal flora: short chain fatty acids
HMS Core Discovery第14期回顾长文|纵享丝滑剪辑,释放视频创作力
Logger and zap log Library in go language
Redis command Encyclopedia
Understand the gut organ axis, good gut and good health
io. Platform. packageRoot; // ignore: deprecated_ Member_ use
leetcode008--实现strStr()函数
MYSQL去重方法汇总
[AI vision · quick review of today's sound acoustic papers, issue 2] Fri, 15 APR 2022
Programmers complain: I really can't live with a salary of 12000. Netizen: how can I say 3000