【发布时间】:2021-04-13 09:11:26
【问题描述】:
虽然我尝试使用垂直滚动背景,但垂直滚动时会出现补丁。
你能解释一下为什么吗?如果背景是水平滚动的,它工作正常!
可能是由于照明问题。
滚动脚本:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Scrollscript : MonoBehaviour
{
private float scrollSpeed = 0.2f;
private Renderer rend;
private Vector2 offset;
// Start is called before the first frame update
void Start() {
rend = GetComponent<Renderer>();
}
// Update is called once per frame
void Update() {
offset = new Vector2(0, Time.time * scrollSpeed);
rend.material.mainTextureOffset = offset;
}
}
【问题讨论】:
标签: unity3d vertical-scrolling