Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

Need some help with some custom code - Its short

$
0
0
Code (CSharp):
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class ProceduralRoomSpawner : MonoBehaviour
  6. {
  7.     [SerializeField] GameObject[] roomPrefab;
  8.  
  9.     Vector3[] newPos = new Vector3[4];
  10.  
  11.  
  12.     private void Start()
  13.     {
  14.  
  15.         newPos[0] = new Vector3(1, 0, 0);
  16.         newPos[1] = new Vector3(-1, 0, 0);
  17.         newPos[2] = new Vector3(0, 0, 1);
  18.         newPos[3] = new Vector3(0, 0, -1);
  19.  
  20.         // a random number between 0 and 3 used to choose...
Need some help with some custom code - Its short

Viewing all articles
Browse latest Browse all 1466670

Trending Articles