Ingen beskrivning
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Floor.cs 448B

123456789101112131415
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Floor : MonoBehaviour
  5. {
  6. [SerializeField] float moveSpeed = 200f;
  7. void FixedUpdate() {
  8. transform.Translate(0,moveSpeed*Time.deltaTime,0);
  9. if(transform.GetComponent<RectTransform>().anchoredPosition.y > 0f){
  10. Destroy(gameObject);
  11. transform.parent.GetComponent<FloorManager>().SpawnFloor();
  12. }
  13. }
  14. }