当前位置:网站首页>Unity rawimage background seamlessly connected mobile
Unity rawimage background seamlessly connected mobile
2022-04-23 04:41:00 【Longpangpang's blog】
1. First create UI RawImage
2. Picture settings
3. effect
4. Code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FilmMove : MonoBehaviour
{
// Speed
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;
// change x or y, To change the moving direction of the picture
r.y += s;
this.m_RawImage.uvRect = r;
}
// Up and down alternately to achieve seamless connection
// 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);
// }
// }
}
版权声明
本文为[Longpangpang's blog]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230441112247.html
边栏推荐
- Go反射—Go语言圣经学习笔记
- mysql ,binlog 日志查询
- 基于英飞凌MCU GTM模块的无刷电机驱动方案开源啦
- 在AWS控制台创建VPC(无图版)
- 用D435i录制自己的数据集运行ORBslam2并构建稠密点云
- KVM error: Failed to connect socket to ‘/var/run/libvirt/libvirt-sock‘
- Youqilin 22.04 lts version officially released | ukui 3.1 opens a new experience
- MYSQL去重方法汇总
- The last day of 2021 is the year of harvest.
- Leetcode005 -- delete duplicate elements in the array in place
猜你喜欢
Jetpack 之 LifeCycle 组件使用详解
zynq平臺交叉編譯器的安裝
520. Detect capital letters
Coinbase:关于跨链桥的基础知识、事实和统计数据
Chapter 4 - understanding standard equipment documents, filters and pipelines
Record your own dataset with d435i, run orbslam2 and build a dense point cloud
AWS EKS 部署要点以及控制台与eksctl创建的差异
Inverse system of RC low pass filter
【时序】基于 TCN 的用于序列建模的通用卷积和循环网络的经验评估
Programmers complain: I really can't live with a salary of 12000. Netizen: how can I say 3000
随机推荐
IDE idea automatic compilation and configuration of on update action and on frame deactivation
Leetcode009 -- search the target value in the array with binary search
【Pytorch基础】torch.split()用法
Basic use of shell WC (counting the number of characters)
leetcode007--判断字符串中的括号是否匹配
针对NFT的网络钓鱼
Flink's important basics
协程与多进程的完美结合
那些年我面试过的Android开发岗总结(附面试题+答案解析)
程序员抱怨:1万2的工资我真的活不下去了,网友:我3千咋说
Effects of antibiotics on microbiome and human health
Supplement: Annotation
Gut liver axis: host microbiota interaction affects hepatocarcinogenesis
leetcode003--判断一个整数是否为回文数
A lifetime of needs, team collaboration can play this way on cloud nailing applet
Go 语言中的 logger 和 zap 日志库
用D435i录制自己的数据集运行ORBslam2并构建稠密点云
递归调用--排列的穷举
io.Platform.packageRoot; // ignore: deprecated_member_use
QML advanced (IV) - drawing custom controls