eastbayeff

Untitled

Nov 24th, 2021
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class Spawner : MonoBehaviour
  6. {
  7.     public GameObject spawnPrefab;
  8.  
  9.     void Update()
  10.     {
  11.         if (Input.GetKeyDown(KeyCode.Space))
  12.         {
  13.             var clone = Instantiate(spawnPrefab);
  14.             clone.GetComponent<Note>().SetLane(Random.Range(1, 5));
  15.         }
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment