유니티 C# 배경 자동으로 움직이기 Background Scrolling


유니티 C# 배경 자동으로 움직이기 Background Scrolling

코드 작성 using UnityEngine; public class BackgroundScrolling : MonoBehaviour { public float scrollSpeed = 2.0f; // 배경 스크롤 속도 public Renderer backgroundRenderer; // 배경 렌더러 private void Update() { // 배경을 스크롤합니다. float offset = Time.time * scrollSpeed; backgroundRenderer.material.mainTextureOffset = new Vector2(0, offset); } }


원문링크 : 유니티 C# 배경 자동으로 움직이기 Background Scrolling