// Use this for initialization void Start () { Time.timeScale = 0; g.Initialize (rooms,gridWidth,gridHeight,!overlappingRooms); for (int i = 0; i < rooms; i++) { CreateRoom (); } Wall (); numRooms = g.NumRooms (); if (AddLights) { lights = gameObject.GetComponent<GenLights> (); CreateLights (); } if (spawnObjects) { spawner = gameObject.GetComponent<Spawner> (); Spawn (); } Time.timeScale = 1; }
// Use this for initialization void Start () { g = new Point[xSize, ySize]; Debug.Log ("Creating grid " + xSize + "x" + ySize); total = xSize * ySize; filled = total; CreateGrid (); CreateNodes (); CreateRooms (); FillEdges (); Carve (); Debug.Log (filled / total + " filled."); CreateWalls (); if (generateLights) { lights = gameObject.GetComponent<GenLights> (); CreateRect (); } if (spawnObjects) { spawner = gameObject.GetComponent<Spawner> (); CreateSpawnableArea (); } }