2026-01-28 14:27:40 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
|
|
// 게임 오브젝트를 계속 왼쪽으로 움직이는 스크립트
|
|
|
|
|
|
public class ScrollingObject : MonoBehaviour {
|
|
|
|
|
|
public float speed = 10f; // 이동 속도
|
|
|
|
|
|
|
2026-01-29 02:32:06 +00:00
|
|
|
|
|
2026-01-28 14:27:40 +00:00
|
|
|
|
private void Update() {
|
2026-01-29 02:32:06 +00:00
|
|
|
|
if(!GameManager.instance.isGameover)
|
|
|
|
|
|
{
|
|
|
|
|
|
transform.Translate(Vector3.left * speed * Time.deltaTime);
|
|
|
|
|
|
// 게임 오브젝트를 왼쪽으로 일정 속도로 평행 이동하는 처리
|
|
|
|
|
|
}
|
2026-01-28 14:27:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|