/// <summary> /// ランダムでマスタイプ設置 /// </summary> /// <param name="currentFloorDungeonSquares">マスタイプ保持配列</param> public void GenerateFloor(E_DungeonSquareType[,] currentFloorDungeonSquares) { currentFloorDungeonSquares = new E_DungeonSquareType[mapWidth, mapHeight]; int countOfDungeonSquaresKind = this.mayAppearDungeonSquares.Count; for (int i = 0; i < this.mapWidth; i++) { for (int j = 0; j < this.mapHeight; j++) { currentFloorDungeonSquares[i, j] = this.mayAppearDungeonSquareTypes[UnityEngine.Random.Range(0, countOfDungeonSquaresKind)]; } } /*for(int i = 0; i < this.mapWidth; i++) * { * for(int j = 0; j < this.mapHeight; j++) * { * if(i == 0 || i == this.mapWidth-1 || j == 0 || j == this.mapHeight - 1) * { * this.mapData.Add(Instantiate(this.wallMass, new Vector3((float)i, (float)j, 0f), Quaternion.identity)); * } * else * { * if(UnityEngine.Random.Range(0, 3) == 0) * { * this.mapData.Add(Instantiate(this.wallMass, new Vector3((float)i, (float)j, 0f), Quaternion.identity)); * } * else * { * this.mapData.Add(Instantiate(this.roadMass, new Vector3((float)i, (float)j, 0f), Quaternion.identity)); * } * } * } * }*/ }
public void DungeonSquareEvent(DungeonManager dm, E_DungeonSquareType dungeonSquareType) { /*if(dungeonSquareType != E_DungeonSquareType.ランダム) * {*/ this.dungeonSquares.Find(ds => ds.SquareType == dungeonSquareType).SquareEvent(dm); /*} * else * { * this.dungeonSquares[UnityEngine.Random.Range(0, this.dungeonSquares.Count)].SquareEvent(dm); * }*/ }