Example #1
0
    void MakeWall(Direction direction, RoomCord cords)
    {
        //string path = "Walls" + System.IO.Path.DirectorySeparatorChar.ToString () + "Side1" + System.IO.Path.DirectorySeparatorChar.ToString () + "Path";
        //GameObject pathObj = GameObject.Instantiate(Resources.Load(path) as GameObject) as GameObject;
        //pathObj.transform.parent = transform;

        /*
         * bool lengthGood = false;
         * int length = Random.Range (1, 3);
         * while(!lengthGood && length > 0)
         * {
         *      lengthGood = true;
         *      for (int i = 0; i < length; i++) {
         *              RoomCord currentPos = cords + i * GetIntDirection(direction);
         *              if(grid[currentPos.xPos, currentPos.yPos] != 0)
         *              {
         *                      length = length - 1;
         *                      lengthGood = false;
         *                      break;
         *              }
         *      }
         * }
         * string path = "Walls" + System.IO.Path.DirectorySeparatorChar.ToString () + "Side1" + System.IO.Path.DirectorySeparatorChar.ToString ();
         * GameObject pathObj = GameObject.Instantiate(Resources.Load(path + length + System.IO.Path.DirectorySeparatorChar.ToString () + "Path") as GameObject) as GameObject;
         * pathObj.transform.parent = transform;
         * pathObj.transform.localPosition = cords.GetLocalPos();
         * pathObj.transform.eulerAngles = new Vector3 (0, 0, GetRotation (direction));
         *
         * for(int i = 0; i < length; i++)
         * {
         *      RoomCord currentPos = cords + i * GetIntDirection(direction);
         *      grid[currentPos.xPos, currentPos.yPos] = 1;
         * }
         */
    }
Example #2
0
 void MakeCorner(Direction direction, RoomCord pos)
 {
     /*
      *      // Load corner object
      *      string pathDelim = System.IO.Path.DirectorySeparatorChar.ToString();
      *      string pathBegin = "Walls" + pathDelim + "Side";
      *      int startingCornerSide = Random.Range (1, 2);
      *      GameObject corner = GameObject.Instantiate (Resources.Load (pathBegin + startingCornerSide + pathDelim +"Corner") as GameObject);
      *
      *      // Put corner in position
      *      corner.transform.parent = transform;
      *      corner.transform.localPosition = pos.GetLocalPos ();
      *
      *      // Mark corner on grid
      *      grid [pos.xPos, pos.yPos] = 2;*/
 }