23 lines
593 B
C#
23 lines
593 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Credits : MonoBehaviour{
|
|
|
|
RectTransform rectTransform;
|
|
Vector2 startPos;
|
|
public float speed;
|
|
public Vector2 end;
|
|
|
|
// Start is called before the first frame update
|
|
void Start(){
|
|
rectTransform = GetComponent<RectTransform>();
|
|
startPos = transform.position;
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update(){
|
|
rectTransform.position = Vector2.MoveTowards(rectTransform.position, end, speed * Time.deltaTime);
|
|
}
|
|
}
|