private void Update() { if (Input.GetKeyDown(KeyCode.R)) { roomCreator.SpawnRooms(numberOfRooms); } GetInput(); UpdateAnimation(); }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); // start camera on player Camera.main.transform.position = new Vector3(transform.position.x, transform.position.y, Camera.main.transform.position.z); roomCreator = new RoomCreator(this.gameObject, this.roomPrefab, this.roomWidth, this.roomHeight); roomCreator.SpawnRooms(numberOfRooms); }