21 lines
446 B
C#
21 lines
446 B
C#
using UnityEngine;
|
|
|
|
public class MoveDown : MonoBehaviour
|
|
{
|
|
public float speed = 200f;
|
|
public float stopY = -6315.304f;
|
|
private RectTransform rectTransform;
|
|
|
|
void Start()
|
|
{
|
|
rectTransform = GetComponent<RectTransform>();
|
|
}
|
|
|
|
void Update()
|
|
{
|
|
if (rectTransform.anchoredPosition.y >= stopY)
|
|
{
|
|
rectTransform.anchoredPosition += Vector2.down * speed * Time.deltaTime;
|
|
}
|
|
}
|
|
} |