当前位置:网站首页>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
边栏推荐
- win10, mysql-8.0.26-winx64.zip 安装
- Recursive call -- Enumeration of permutations
- Recommended scheme for national production of electronic components for wireless charging
- Logger and zap log Library in go language
- Error occurs when thymeleaf th: value is null
- IEEE Transactions on Industrial Informatics(TII)投稿须知
- 補:注解(Annotation)
- [AI vision · quick review of today's sound acoustic papers, issue 3] wed, 20 APR 2022
- QML进阶(四)-绘制自定义控件
- KVM error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock‘
猜你喜欢
383. 赎金信
win10, mysql-8.0.26-winx64.zip 安装
QML进阶(五)-通过粒子模拟系统实现各种炫酷的特效
RC低通滤波器的逆系统
Effects of antibiotics on microbiome and human health
Eight misunderstandings that should be avoided in data visualization
指纹Key全国产化电子元件推荐方案
Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
IDE Idea 自动编译 与 On Upate Action 、 On Frame Deactivation 的配置
Brushless motor drive scheme based on Infineon MCU GTM module
随机推荐
AWS EKS 部署要点以及控制台与eksctl创建的差异
Small volume Schottky diode compatible with nsr20f30nxt5g
1个需求的一生,团队协作在云效钉钉小程序上可以这么玩
Shanghai Hangxin technology sharing 𞓜 overview of safety characteristics of acm32 MCU
Create VPC in AWS console (no plate)
Chlamydia infection -- causes, symptoms, treatment and Prevention
MySQL - data read / write separation, multi instance
Go 语言中的 logger 和 zap 日志库
AWS eks add cluster user or Iam role
无线键盘全国产化电子元件推荐方案
io. Platform. packageRoot; // ignore: deprecated_ Member_ use
[timing] empirical evaluation of general convolution and cyclic networks for sequence modeling based on TCN
Leetcode - > 1 sum of two numbers
针对NFT的网络钓鱼
第四章 --- 了解标准设备文件、过滤器和管道
Leetcode003 -- judge whether an integer is a palindrome number
Experience summary and sharing of the first prize of 2021 National Mathematical Modeling Competition
电钻、电锤、电镐的区别
Basic use of shell WC (counting the number of characters)
FAQ of foreign lead and alliance Manager