示例#1
0
 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);
             }
         }
     }
 }
示例#2
0
 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);
             }
         }
     }
 }
示例#3
0
        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);
        }
示例#4
0
        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);
                    }
                }
            }
        }