当前位置:网站首页>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
边栏推荐
猜你喜欢
AWS EKS 部署要点以及控制台与eksctl创建的差异
针对NFT的网络钓鱼
MySQL queries users logged in for at least N consecutive days
520. Detect capital letters
QML进阶(五)-通过粒子模拟系统实现各种炫酷的特效
Inverse system of RC low pass filter
A new method for evaluating the quality of metagenome assembly - magista
Druid -- JDBC tool class case
[timing] empirical evaluation of general convolution and cyclic networks for sequence modeling based on TCN
Recommended scheme for national production of electronic components for wireless charging
随机推荐
Jetpack 之 LifeCycle 组件使用详解
MYSQL50道基础练习题
Migrate from MySQL database to AWS dynamodb
229. 求众数 II
IDE idea automatic compilation and configuration of on update action and on frame deactivation
Huawei machine test -- high precision integer addition
zynq平臺交叉編譯器的安裝
leetcode004--罗马数字转整数
Recommended scheme for national production of electronic components for wireless charging
[pytoch foundation] torch Split() usage
在AWS控制台创建VPC(无图版)
Effects of antibiotics on microbiome and human health
Interaction of diet gut microbiota on cardiovascular disease
Supplement 14: cmake practice project notes (to be continued 4 / 22)
520.检测大写字母
Inverse system of RC low pass filter
【论文阅读】【3d目标检测】Voxel Transformer for 3D Object Detection
Go反射法则
C language: Advanced pointer
PIP3 installation requests Library - the most complete pit sorting