public void AddRandomFurniture(string name, string furnitureDirection, int treshold) { bool[,] map = StageConstructor.createRandomMap(rct, treshold); for (int x = 0; x < map.GetLength(0); x++) { for (int z = 0; z < map.GetLength(1); z++) { if (map[x, z]) { addFurniture(name, new CRD(x + rct.Start.x, z + rct.Start.z), furnitureDirection); } } } }
public void AddPeriodicalFurniture(string name, string furnitureDirection, char axis, int offset, int step) { bool[,] map = StageConstructor.createPeriodicalMap(rct, axis, offset, step); for (int x = 0; x < map.GetLength(0); x++) { for (int z = 0; z < map.GetLength(1); z++) { if (map[x, z]) { addFurniture(name, new CRD(x + rct.Start.x, z + rct.Start.z), furnitureDirection); } } } }
public override void HookAddToChildElements() { surface = "Road"; AddLayer(new NodeLayer(0, "Premetives/Surface", "Sidewalk")); if (parentElement.GetType() != typeof(BackgroundStreet)) { AddLayer(new NodeLayer(0, "Main", "ControllQuad")); } NodeLayer lights = new NodeLayer(getPrefabNuber(), "Additions/Pilars", "NightLight"); int offset = 2; int roadOffset = getRoadOffset(offset); lights.addMap(StageConstructor.createPeriodicalMap(rct, axis, roadOffset, 7)); lights.hasMesh = false; lights.nonWalkable = true; AddLayer(lights); }
public void AddRandomFurniture(string furnitureDirection, int treshold) { int furnitureListCount = furnitureList.Count; if (furnitureListCount < 0) { return; } bool[,] map = StageConstructor.createRandomMap(rct, treshold); for (int x = 0; x < map.GetLength(0); x++) { for (int z = 0; z < map.GetLength(1); z++) { if (map[x, z]) { float rand = Random.Range(0, furnitureListCount * 100) / 100; int index = Mathf.RoundToInt(rand); string name = furnitureList[index]; addFurniture(name, new CRD(x + rct.Start.x, z + rct.Start.z), furnitureDirection); } } } }