123456789101112131415 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class Floor : MonoBehaviour
- {
- [SerializeField] float moveSpeed = 200f;
- void FixedUpdate() {
- transform.Translate(0,moveSpeed*Time.deltaTime,0);
- if(transform.GetComponent<RectTransform>().anchoredPosition.y > 0f){
- Destroy(gameObject);
- transform.parent.GetComponent<FloorManager>().SpawnFloor();
- }
- }
- }
|