예제 #1
0
        private void RoomInformation(object sender, MouseButtonEventArgs e)
        {
            Rectangle       rect      = (Rectangle)sender;
            RoomInformation worktime1 = new RoomInformation(rect.Name);

            worktime1.Show();
        }
예제 #2
0
 void Start()
 {
     _roomInformation = GameObject.Find("RoomManager").GetComponent <RoomInformation>();
     pv = GetComponent <PhotonView>();
     //_playerManager.initPlayerInfo();
     GameCondition = GameObject.FindGameObjectWithTag("ConditionManager").GetComponent <GameCondition>();
     timea         = GameObject.FindWithTag("Timer").GetComponent <Time_AA>();
     Texts         = GameObject.FindWithTag("Canvas").GetComponentsInChildren <Text>();
     for (int i = 0; i < Texts.Length; i++)
     {
         if (Texts[i].name == "CountDownText")
         {
             CountDownText = Texts[i];
         }
         else if (Texts[i].name == "RankText")
         {
             RankText = Texts[i];
         }
         else if (Texts[i].name == "TrackText")
         {
             TrackText = Texts[i];
         }
     }
     GameUI.SetActive(false);
     RewardUI.SetActive(false);
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        tiles = new TileInformation[width, height];
        for (int i = 0; i < width; i++)
        {
            for (int j = 0; j < height; j++)
            {
                tiles[i, j] = new TileInformation(i, j);
            }
        }

        int numRooms = Mathf.CeilToInt(Random.value * (averageRoomCount)) + 2;

        rooms = new RoomInformation[numRooms]; //(w,h),(x,y)

        for (int i = 0; i < numRooms; i++)
        {
            Vector2 size    = new Vector2(Mathf.CeilToInt(RandomNormal(averageRoomSize)), Mathf.CeilToInt(RandomNormal(averageRoomSize)));
            Vector2 postion = new Vector2((Mathf.CeilToInt(Random.value * (width - size.x))) % width, (Mathf.CeilToInt(Random.value * (height - size.y))) % height);
            rooms[i] = new RoomInformation(postion, size);
        }

        GenerateRooms(rooms);
        AttachIsolatedRooms(rooms);

        for (int i = 0; i < numRooms; i++)
        {
            Debug.Log("Room " + i + ": pos(" + rooms[i].getPosition().x + ", " + rooms[i].getPosition().y
                      + ") size(" + rooms[i].getSize().x + ", " + rooms[i].getSize().y
                      + ") " + rooms[i].getAdjacencyState());
        }
    }
예제 #4
0
 private void Start()
 {
     _roomInformation = GameObject.Find("RoomManager").GetComponent <RoomInformation>();
     ReferencePoint   = GameObject.Find("CenterPoint").GetComponent <Transform>();
     PlayerTransform  = GameObject.Find(_roomInformation.MyName).GetComponent <Transform>();
     AddUser(_roomInformation.MyName);
 }
    private async Task SendServerRequest(string roomName, string playerId)
    {
        Debug.Log("Sending Join Request: " + roomName + " : " + playerId);
        if (!string.IsNullOrEmpty(roomName) && !string.IsNullOrEmpty(playerId))
        {
            // No Nulls in request room!
            Debug.Log("Valid. Sent.");

            var             serverApi        = ServerApi.Instance;
            RoomInformation joinRoomResponse = await serverApi.JoinRoomAsync(roomName, playerId);

            Debug.Log($"{nameof(joinRoomResponse)}:{joinRoomResponse.ToJson()}");
            GameLogicManager.instance.UpdateGameState(joinRoomResponse.Playing, joinRoomResponse.Waiting);
            bool badResponse = joinRoomResponse.ToJson() == "{}";
            if (badResponse)
            {
                // Try room info as fallback. Maybe we're already in there.
                Debug.Log("Trying to get Room Info Anyway...");
                RoomInformation roomInfoResponse = await serverApi.RoomInformationAsync(roomName);

                Debug.Log($"{nameof(roomInfoResponse)}:{roomInfoResponse.ToJson()}");
                GameLogicManager.instance.UpdateGameState(roomInfoResponse.Playing, roomInfoResponse.Waiting);
            }
        }
    }
예제 #6
0
    /// <summary>
    /// Get a new task from the list of tasks
    /// </summary>
    public ITask GetNewTask()
    {
        debugHolder.Log("Get a new Task", eDebugImportance.Unimportant);
        List <ITask> allTasks = new List <ITask>();

        allTasks.AddRange(personalTasks.Tasks);
        allTasks.AddRange(globalTasks.Tasks);
        List <NavMeshMovementLine> newPath = new List <NavMeshMovementLine>();

        for (int i = 0; i < allTasks.Count; i++)
        {
            if (!allTasks[i].IsTaskValid)
            {
                switch (allTasks[i].GetTaskScope)
                {
                case TaskScope.Global:
                    globalTasks.Remove(allTasks[i]);
                    break;

                case TaskScope.Personal:
                    personalTasks.Remove(allTasks[i]);
                    break;
                }
                continue;
            }
            newPath.Clear();
            //Quick check to see if the task is possible
            if (allTasks[i] != null)
            {
                RoomInformation targetRoom = GetRoomInformationForLocation(allTasks[i].GetInteractionPosition);
                if (targetRoom != null)
                {
                    Vertex targetVertex = targetRoom.GetCenterVertex;
                    newPath = traversalAStar.GetPathFromTo(currentRoom.GetCenterVertex, targetVertex);
                }
            }
            else
            {
                Debug.Log("Could not find route");
                newPath = null;
            }
            if (currentRoom != null && newPath != null && newPath.Count > 0)
            {
                switch (allTasks[i].GetTaskScope)
                {
                case TaskScope.Global:
                    globalTasks.Remove(allTasks[i]);
                    break;

                case TaskScope.Personal:
                    personalTasks.Remove(allTasks[i]);
                    break;
                }
                debugHolder.Log("Found a task (" + allTasks[i].GetTaskInformation + ")", eDebugImportance.Unimportant);
                newPath.Clear();
                return(allTasks[i]);
            }
        }
        return(new WanderTask("Wander " + currentRoom.name, TaskScope.Personal, currentRoom.GetRandomSpotInsideRoom, null, 2, 5, true, 1, 3));
    }
예제 #7
0
    public void StartFire(RoomInformation room, int triangleID)
    {
        if (isOnFire)
        {
            return;
        }
        mesh     = new Mesh();
        isOnFire = true;
        particleSystem.Play();
        smokeParticleSystem.Play();

        fireLifeTimer = fireLifetime;

        this.room = room;
        Vertex[]  vertices = room.NavMeshGenerator.Vertexes;
        Vector3[] verts    = new Vector3[vertices.Length];
        for (int i = 0; i < vertices.Length; i++)
        {
            verts[i] = vertices[i].LocalPosition;
        }
        NavMeshTriangle[] triangles = room.NavMeshGenerator.Triangles;
        tris = new int[triangles.Length * 3];

        AddTriangle(tris, triangles[triangleID], burningTris, availableTris);
        mesh.vertices  = verts;
        mesh.triangles = tris;
        filler.mesh    = mesh;
        var sh = particleSystem.shape;

        sh.shapeType = ParticleSystemShapeType.Mesh;
        sh.mesh      = mesh;
        sh           = smokeParticleSystem.shape;
        sh.shapeType = ParticleSystemShapeType.Mesh;
        sh.mesh      = mesh;
    }
예제 #8
0
    private void Update()
    {
        RoomInformation startingRoom = null;

        startingRoom = GetRoomInformationForLocation(this.transform.position);
        if (startingRoom == null)
        {
            startingRoom = traversalGraphHolder.GetClosestGenerator(this.transform.position)?.containedRoom;
        }
        RoomInformation endingRoom = null;

        endingRoom = GetRoomInformationForLocation(end.position);
        if (endingRoom == null)
        {
            endingRoom = traversalGraphHolder.GetClosestGenerator(end.position)?.containedRoom;
        }

        // ReSharper disable once ConditionIsAlwaysTrueOrFalse
        if (startingRoom != null && endingRoom != null)
        // ReSharper disable once HeuristicUnreachableCode
        {
            path = LevelOfDetailNavigationSolver.GetLODPath(this.transform.position, end.position,
                                                            startingRoom, endingRoom, graphNavigation);
        }
    }
예제 #9
0
 public void Setup(GameObject teleportPoint)
 {
     tpPoint          = teleportPoint;
     roomInfo         = tpPoint.GetComponent <RoomInformation>();
     label.text       = roomInfo.roomName;
     colorImage.color = roomInfo.colorCode;
 }
예제 #10
0
    void UpdateRoomQueue()
    {
        if (isLoadingRoom)
        {
            return;
        }

        if (roomQueue.Count == 0)
        {
            if (!createBossRoom)
            {
                StartCoroutine(CreateBossRoom());
            }
            else if (!createHiddenRoom)
            {
                StartCoroutine(CreateHiddenRoom());
            }
            else if (createBossRoom && createHiddenRoom && !updatedRoom)
            {
                foreach (Room room in roomList)
                {
                    room.RemoveUnconnectedDoors();
                }
                updatedRoom = true;
            }
            return;
        }

        currentLoadRoomData = roomQueue.Dequeue();
        isLoadingRoom       = true;
        StartCoroutine(LoadRoomRoutine(currentLoadRoomData));
    }
예제 #11
0
        public ActionResult DeleteConfirmed(long id)
        {
            RoomInformation roomInformation = db.RoomInformations.Find(id);

            db.RoomInformations.Remove(roomInformation);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        protected void saveButton_Click(object sender, EventArgs e)
        {
            RoomInformation aRoomInformation = new RoomInformation();

            aRoomInformation.RoomNo         = roomNoTextBox.Text;
            aRoomInformation.SelectCatagory = selectCategoryDropDownList.Text;
            aRoomInformation.Description    = descriptionTextBox.Text;
        }
예제 #13
0
        private void Awake()
        {
            roomInfo = GetComponent <RoomInformation>();

            // The extents are actaully halfExtents
            float x = roomInfo.extents.x;
            float z = roomInfo.extents.z;

            int numberOfXTiles = Mathf.CeilToInt(x / tileSize);
            int numberOfZTiles = Mathf.CeilToInt(z / tileSize);

            grid = new GridPoint[numberOfXTiles, numberOfZTiles];
            Quaternion rot      = this.transform.rotation;
            Vector3    transPos = this.transform.position;

            for (int i = 0; i < grid.GetLength(0); i++)
            {
                for (int j = 0; j < grid.GetLength(1); j++)
                {
                    grid[i, j]      = new GridPoint();
                    grid[i, j].room = this;
                    Vector3 pos = transPos + rot * new Vector3((i * tileSize) + tileSize / 2, 0, (j * tileSize) + tileSize / 2);
                    grid[i, j].center           = pos;
                    grid[i, j].adjacentPointsXY = GetAdjacentXY(i, j, grid.GetLength(0), grid.GetLength(1));
                }
            }
            entrancePoints = new Vector2Int[roomInfo.GetEntrances.Length];
            entranceIds    = new int[roomInfo.GetEntrances.Length];
            for (int i = 0; i < roomInfo.GetEntrances.Length; i++)
            {
                Vector3 entrancePos = (roomInfo.GetEntrance(i).entranceMidPoint.transform.localPosition) / tileSize;
                int     xPos        = Mathf.FloorToInt(entrancePos.x);
                if (xPos >= grid.GetLength(0))
                {
                    xPos = grid.GetLength(0) - 1;
                }
                else if (xPos < 0)
                {
                    xPos = 0;
                }

                int zPos = Mathf.FloorToInt(entrancePos.z);
                if (zPos >= grid.GetLength(1))
                {
                    zPos = grid.GetLength(1) - 1;
                }
                else if (zPos < 0)
                {
                    zPos = 0;
                }

                grid[xPos, zPos].entrance   = roomInfo.GetEntrance(i);
                grid[xPos, zPos].isEntrance = true;
                entrancePoints[i]           = new Vector2Int(xPos, zPos);
                entranceIds[i] = roomInfo.GetEntrance(i).ID;
            }
        }
예제 #14
0
 private void Start()
 {
     _roomInformation = GameObject.Find("RoomManager").GetComponent <RoomInformation>();
     CheckPoint       = GameObject.FindGameObjectsWithTag("CheckPoint");
     for (int i = 0; i < CheckPoint.Length; i++)
     {
         CheckPointDictionary.Add(CheckPoint[i], false);
     }
 }
예제 #15
0
//    private Ranking Rank;

    private void Start()
    {
        _roomInformation = GameObject.Find("RoomManager").GetComponent <RoomInformation>();
        _playerManager   = GameObject.Find("PlayerManager").GetComponent <PlayerManager>();
        _csTouch         = GameObject.Find("ARManager").GetComponent <csTouchMgr>();
        gameCondition    = GameObject.FindGameObjectWithTag("ConditionManager").GetComponent <GameCondition>();
        Myname           = _roomInformation.MyName;
//        CheckPointKeyList = gameCondition.CheckPointDictionary.Keys.ToList();
    }
예제 #16
0
 protected void FindCurrentRoom()
 {
     for (int i = 0; i < levelGeneration.GeneratedRooms.Count; i++)
     {
         if (levelGeneration.GeneratedRooms[i].IsInsideRoomArea(this.transform.position))
         {
             currentRoom = levelGeneration.GeneratedRooms[i];
         }
     }
 }
예제 #17
0
    IEnumerator LoadRoomRoutine(RoomInformation info)
    {
        string         roomName = currentRoomName + info.name;
        AsyncOperation loadRoom = SceneManager.LoadSceneAsync(roomName, LoadSceneMode.Additive);

        while (loadRoom.isDone == false)
        {
            yield return(null);
        }
    }
예제 #18
0
 public ActionResult Edit([Bind(Include = "id,Room_Name,Room_No,Confirm_Room")] RoomInformation roomInformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roomInformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(roomInformation));
 }
예제 #19
0
 public ActionResult Edit([Bind(Include = "RmRoomId,RmRoomNo,RmFloorNo,RmCapacity,RmDescription,RmCampus")] RoomInformation roomInformation)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roomInformation).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(roomInformation));
 }
예제 #20
0
    public override bool Equals(object other)
    {
        if (other == null)
        {
            return(false);
        }

        RoomInformation room = (RoomInformation)other;

        return(room.roomID == roomID);
    }
예제 #21
0
 public NavMeshEntrance GetDoorForRoom(RoomInformation roomInformation)
 {
     for (int i = 0; i < GetEntrances.Length; i++)
     {
         if (GetEntrances[i].ID == roomInformation.ID)
         {
             return(GetEntrances[i]);
         }
     }
     return(null);
 }
예제 #22
0
    private void Start()
    {
        RoomInformation initRoom = Instantiate <RoomInformation>(initialRoom, this.transform);

        generatedRooms.Add(initRoom);
        traversalGraphHolder.AddTraversalLines(initRoom.TraversalGenerator);
        AddEntrancesToAvailableEntrances(initRoom.GetEntrances.ToList(), 0);
        initRoom.SetID(0);
        roomGraph.AddRoom(initRoom, null);
        generationMap.AddRectangle(initRoom.transform.position + initRoom.center, initRoom.extents);
    }
예제 #23
0
 public string Save(RoomInformation aRoomInformation)
 {
     if (aRoomInformation.RoomNo.Length > 3)
     {
         return("Successfully Saved");
     }
     else
     {
         return("Save Failed");
     }
 }
예제 #24
0
 // GET: Information
 public InformationController()
 {
     studentInformation           = new StudentInformation();
     roomInformation              = new RoomInformation();
     districtInformation          = new DistrictInformation();
     addressInformation           = new AddressInformation();
     departmentInformation        = new DepartmentInformation();
     studentDepartmentInformation = new StudentDepartmentInformation();
     mealInformation              = new MealInformation();
     accountInformation           = new AccountInformation();
 }
예제 #25
0
        public ActionResult Create([Bind(Include = "RmRoomId,RmRoomNo,RmFloorNo,RmCapacity,RmDescription,RmCampus")] RoomInformation roomInformation)
        {
            if (ModelState.IsValid)
            {
                db.RoomInformations.Add(roomInformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(roomInformation));
        }
예제 #26
0
        public ActionResult Create([Bind(Include = "id,Room_Name,Room_No,Confirm_Room")] RoomInformation roomInformation)
        {
            if (ModelState.IsValid)
            {
                db.RoomInformations.Add(roomInformation);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(roomInformation));
        }
예제 #27
0
 void Start()
 {
     roomInformation    = GameObject.Find("RoomManager").GetComponent <RoomInformation>();
     panelonoff         = GameObject.Find("PanelOnOff").GetComponent <PanelOnOff>();
     ResetPassword      = GameObject.Find("ResetPassword");
     LoginCheckText     = GameObject.Find("LoginCheck").GetComponent <Text>();
     IdCheckText        = GameObject.Find("IdCheckText").GetComponent <Text>();
     PasswordCheckText  = GameObject.Find("PasswordCheckText").GetComponent <Text>();
     NickNameCheckText  = GameObject.Find("NickNameCheckText").GetComponent <Text>();
     EmailCheckText     = GameObject.Find("EmailCheckText").GetComponent <Text>();
     SendEmailCheckText = GameObject.Find("SendEmailCheckText").GetComponent <Text>();
 }
예제 #28
0
 public void AddConnectedRoom(RoomInformation containedRoom, NavMeshEntrance randomEntrance)
 {
     try
     {
         connectedRooms.Add(randomEntrance.ID, containedRoom);
     }
     catch (Exception ex)
     {
         Debug.Log("Connected Room Failed " + this.name + " to " + containedRoom.name + " from entrance " + randomEntrance.ID);
         Debug.Log("Error: " + ex.Message);
     }
 }
예제 #29
0
    public RoomInformation GetConnectedRoomFromEntranceWithID(int connectedEntranceID)
    {
        RoomInformation roomInformation = null;

        try
        {
            connectedRooms.TryGetValue(connectedEntranceID, out roomInformation);
        }
        catch
        {
        }
        return(roomInformation);
    }
예제 #30
0
 public ModerationTicket(int ticketId, int ticketType, double ticketTimestamp, int ticketCategory, int ticketPriority, PlayerData ticketSender, PlayerData ticketTarget, string issue, RoomInformation ticketRoomInformation)
 {
     _ticketId              = ticketId;
     _ticketType            = ticketType;
     _ticketTimestamp       = ticketTimestamp;
     _ticketCategory        = ticketCategory;
     _ticketPriority        = ticketPriority;
     _ticketAnswered        = false;
     _ticketSender          = ticketSender;
     _ticketTarget          = ticketTarget;
     _moderator             = null;
     _issue                 = issue;
     _ticketRoomInformation = ticketRoomInformation;
 }
    private void InitPhysicsRooms(RoomInformation roomInformation)
    {
        rooms = roomInformation.physicsRooms;

        ROOM_MAX_X = roomInformation.ROOM_MAX_X;
        ROOM_MAX_Y = roomInformation.ROOM_MAX_Y;

        // 速度点は(部屋の数+1)個存在する.
        NX = ROOM_MAX_X;
        NY = ROOM_MAX_Y;
    }
    public RoomInformation GetRegularRoomInformation(string itemName)
    {
        TextAsset roomTextAsset = Resources.Load(itemName) as TextAsset;

        string[] All_Colmn = roomTextAsset.text.Split('\n');
        int ROOM_MAX_Y = All_Colmn.Length;
        // csvファイルの仕様のため-1する.
        int ROOM_MAX_X = All_Colmn[0].Split(',').Length - 1;
        GameObject physicsRoomPrefab = Resources.Load("Re_Room") as GameObject;
        GameObject wallRoomPrefab = Resources.Load("Re_Wall") as GameObject;
        GameObject inLetRoomPrefab = Resources.Load("Re_InLet") as GameObject;
        GameObject outLetRoomPrefab = Resources.Load("Re_OutLet") as GameObject;
        GameObject safeRoomPrefab = Resources.Load ("SafeAria")as GameObject;
        List<List<GameObject>> rooms = new List<List<GameObject>>();
        RoomInformation roomInformation = new RoomInformation();

        roomInformation.ROOM_MAX_X = ROOM_MAX_X;
        roomInformation.ROOM_MAX_Y = ROOM_MAX_Y;
        roomInformation.physicsRooms = rooms;

        for (int Y = 0; Y < ROOM_MAX_Y; Y++)
        {

            rooms.Add(new List<GameObject>());

            string[] values = All_Colmn[Y].Split(',');
            for (int X = 0; X < ROOM_MAX_X; X++)
            {

                string value = values[X];
                GameObject roomObject = null;

                switch (value)
                {
                case "0":
                    roomObject = Instantiate(physicsRoomPrefab);
                    break;

                case "1":
                    roomObject = Instantiate(wallRoomPrefab);
                    break;

                case "I":
                    roomObject = Instantiate(inLetRoomPrefab);
                    break;

                case "O":
                    roomObject = Instantiate(outLetRoomPrefab);
                    break;

                case "S":
                    roomObject = Instantiate (safeRoomPrefab);
                    break;

                default:
                    roomObject = Instantiate(wallRoomPrefab);
                    break;
                }

                Vector3 newPosition = Vector3.zero;
                if (ROOM_MAX_X % 2 == 0)
                {

                newPosition = new Vector3(
                    (-(ROOM_MAX_X - 1) / 2 + X) * ROOM_SPRITE_LENGTH + transform.position.x - ROOM_SPRITE_LENGTH / 2,
                    (-(ROOM_MAX_Y - 1) / 2 + Y) * ROOM_SPRITE_LENGTH + transform.position.y - ROOM_SPRITE_LENGTH / 2,
                    1.0f
                );
                }
                else
                {
                newPosition = new Vector3(
                    (-(ROOM_MAX_X - 1) / 2 + X) * ROOM_SPRITE_LENGTH + transform.position.x,
                    (-(ROOM_MAX_Y - 1) / 2 + Y) * ROOM_SPRITE_LENGTH + transform.position.y,
                    1.0f
                );
                }

                roomObject.transform.localPosition = newPosition;
                roomObject.transform.SetParent(transform);
                roomObject.name = "Room(" + X.ToString() + " , " + Y.ToString() + ")";

                rooms[Y].Add(roomObject);

            }

        }

        return roomInformation;
    }
    public RoomInformation Get_Random_OutletInlet_RoomInformation(string itemName,RoomInformation oldroomInformation ,int OutletNumber, int InletNumber)
    {
        // 全て削除.
        /*
        for (var i = 0; i < oldroomInformation.ROOM_MAX_X; i++) {
            for (var j = 0; j < oldroomInformation.ROOM_MAX_Y; j++) {
                Destroy (oldroomInformation.physicsRooms [j] [i].gameObject);
            }
        }*/
        for (int i = 0; i < FluidMechanicsController.Instance.gameObject.transform.childCount; i++) {
            Destroy (FluidMechanicsController.Instance.gameObject.transform.GetChild(i).gameObject);
        }

        // 煙削除.
        GameObject[] smokes = GameObject.FindGameObjectsWithTag ("Smoke");
        foreach(GameObject Obj in smokes){
            Destroy (Obj);
        }

        // 生成
        TextAsset roomTextAsset = Resources.Load (itemName) as TextAsset;

        string[] All_Colmn = roomTextAsset.text.Split ('\n');
        int ROOM_MAX_Y = All_Colmn.Length;
        // csvファイルの仕様のため-1する.
        int ROOM_MAX_X = All_Colmn [0].Split (',').Length - 1;
        GameObject physicsRoomPrefab = Resources.Load ("Room") as GameObject;
        GameObject wallRoomPrefab = Resources.Load ("Wall") as GameObject;
        GameObject inLetRoomPrefab = Resources.Load ("InLet") as GameObject;
        GameObject outLetRoomPrefab = Resources.Load ("OutLet") as GameObject;
        GameObject safeRoomPrefab = Resources.Load ("SafeAria") as GameObject;
        GameObject tabaccoinPhysicsRoomPrefab = Resources.Load ("TabaccoInRoom") as GameObject;
        List<List<GameObject>> rooms = new List<List<GameObject>> ();
        RoomInformation roomInformation = new RoomInformation ();

        roomInformation.ROOM_MAX_X = ROOM_MAX_X;
        roomInformation.ROOM_MAX_Y = ROOM_MAX_Y;
        roomInformation.physicsRooms = rooms;

        int leftSideX = 0, rightSideX = roomInformation.ROOM_MAX_X - 1;
        InletOutletInitPositions inoutPositions = RandomNumbers (ROOM_MAX_X - 1, 1, (roomInformation.ROOM_MAX_Y - 2), OutletNumber, InletNumber);

        for(int Y = 0; Y < ROOM_MAX_Y; Y++){

            rooms.Add (new List<GameObject> ());

            string[] values = All_Colmn[Y].Split (',');
            for (int X = 0; X < ROOM_MAX_X; X++) {
                string value = values [X];
                GameObject roomObject = null;

                switch (value) {
                case "0":
                    roomObject = Instantiate (physicsRoomPrefab);
                    break;

                case "1":
                    roomObject = Instantiate (wallRoomPrefab);
                    break;
                    /*
                case "I":
                    roomObject = Instantiate (inLetRoomPrefab);
                    break;

                case "O":
                    roomObject = Instantiate (outLetRoomPrefab);
                    break;

                case "L":
                    roomObject = Instantiate (inLetRoomPrefab);
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (1.0f, 0.0f);
                    break;

                case "R":
                    roomObject = Instantiate (inLetRoomPrefab);
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (-1.0f, 0.0f);
                    break;

                case "D":
                    roomObject = Instantiate (inLetRoomPrefab);
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (0.0f, -1.0f);
                    break;

                case "U":
                    roomObject = Instantiate (inLetRoomPrefab);
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (0.0f, 1.0f);
                    break;
                    */

                case "S":
                    roomObject = Instantiate (safeRoomPrefab);
                    break;

                case "T":
                    roomObject = Instantiate (tabaccoinPhysicsRoomPrefab);
                    break;

                default:
                    roomObject = Instantiate (wallRoomPrefab);
                    break;
                }

                Vector3 newPosition = Vector3.zero;
                if (ROOM_MAX_X % 2 == 0)
                {

                newPosition = new Vector3(
                    (-(ROOM_MAX_X - 1) / 2 + X) * ROOM_SPRITE_LENGTH + transform.position.x - ROOM_SPRITE_LENGTH / 2,
                    (-(ROOM_MAX_Y - 1) / 2 + Y) * ROOM_SPRITE_LENGTH + transform.position.y - ROOM_SPRITE_LENGTH / 2,
                    1.0f
                );
                }
                else
                {
                newPosition = new Vector3(
                    (-(ROOM_MAX_X - 1) / 2 + X) * ROOM_SPRITE_LENGTH + transform.position.x,
                    (-(ROOM_MAX_Y - 1) / 2 + Y) * ROOM_SPRITE_LENGTH + transform.position.y,
                    1.0f
                );
                }

                roomObject.transform.localPosition = newPosition;
                roomObject.transform.SetParent(transform);
                roomObject.name = "Room(" + X.ToString() + " , " + Y.ToString() + ")";

                rooms [Y].Add (roomObject);

            }

        }

        // Inletに置換
        for (int i = 0; i < inoutPositions.InletPos.Length; i++) {
            Vector2Int tmp = inoutPositions.InletPos [i];
            GameObject roomObject = Instantiate (inLetRoomPrefab);
            if (tmp.x == 0) {
                roomObject.GetComponent<PhysicsRoom> ().constantVelocity = Vector2.right * velocityScale;
            } else {
                roomObject.GetComponent<PhysicsRoom> ().constantVelocity = Vector2.left * velocityScale;
            }

            GameObject old = rooms [tmp.y] [tmp.x];
            roomObject.transform.position = old.transform.position;
            roomObject.name = old.name;
            roomObject.transform.parent = old.transform.parent;

            rooms [tmp.y].RemoveAt (tmp.x);
            rooms [tmp.y].Insert (tmp.x, roomObject);
            Destroy (old);

            roomObject.GetComponent<PhysicsRoom> ().myType = RoomType.InLet;
        }

        // Outletに置換
        for (int i = 0; i < inoutPositions.OutletPos.Length; i++) {
            Vector2Int tmp = inoutPositions.OutletPos [i];
            GameObject roomObject = Instantiate (outLetRoomPrefab);
            if (tmp.x == 0) {
                roomObject.GetComponent<PhysicsRoom> ().constantVelocity = Vector2.left * velocityScale;
            } else {
                roomObject.GetComponent<PhysicsRoom> ().constantVelocity = Vector2.right * velocityScale;
            }

            GameObject old = rooms [tmp.y] [tmp.x];

            roomObject.transform.position = old.transform.position;
            roomObject.name = old.name;
            roomObject.transform.parent = old.transform.parent;

            rooms [tmp.y].RemoveAt (tmp.x);
            rooms [tmp.y].Insert (tmp.x, roomObject);
            Destroy(old);

            roomObject.GetComponent<PhysicsRoom> ().myType = RoomType.OutLet;
        }

        roomInformation.inletPositions = inoutPositions.InletPos;
        roomInformation.outletPostions = inoutPositions.OutletPos;

        return roomInformation;
    }
    public RoomInformation GetRoomInformation(string itemName)
    {
        TextAsset roomTextAsset = Resources.Load (itemName) as TextAsset;

        string[] All_Colmn = roomTextAsset.text.Split ('\n');
        int ROOM_MAX_Y = All_Colmn.Length;
        // csvファイルの仕様のため-1する.
        int ROOM_MAX_X = All_Colmn [0].Split (',').Length - 1;
        GameObject physicsRoomPrefab = Resources.Load ("Room") as GameObject;
        GameObject wallRoomPrefab = Resources.Load ("Wall") as GameObject;
        GameObject inLetRoomPrefab = Resources.Load ("InLet") as GameObject;
        GameObject outLetRoomPrefab = Resources.Load ("OutLet") as GameObject;
        GameObject safeRoomPrefab = Resources.Load ("SafeAria") as GameObject;
        GameObject tabaccoinPhysicsRoomPrefab = Resources.Load ("TabaccoInRoom") as GameObject;
        List<List<GameObject>> rooms = new List<List<GameObject>> ();
        RoomInformation roomInformation = new RoomInformation ();

        roomInformation.ROOM_MAX_X = ROOM_MAX_X;
        roomInformation.ROOM_MAX_Y = ROOM_MAX_Y;
        roomInformation.physicsRooms = rooms;

        for (int i = 0; i < FluidMechanicsController.Instance.gameObject.transform.childCount; i++) {
            Destroy (FluidMechanicsController.Instance.gameObject.transform.GetChild(i).gameObject);
        }

        for(int Y = 0; Y < ROOM_MAX_Y; Y++){

            rooms.Add (new List<GameObject> ());

            string[] values = All_Colmn[Y].Split (',');
            for (int X = 0; X < ROOM_MAX_X; X++) {
                string value = values [X];
                GameObject roomObject = null;

                switch (value) {
                case "0":
                    roomObject = Instantiate (physicsRoomPrefab);
                    break;

                case "1":
                    roomObject = Instantiate (wallRoomPrefab);
                    break;

                case "L":
                    if (X == 0) {
                        roomObject = Instantiate (outLetRoomPrefab);
                    } else {
                        roomObject = Instantiate (inLetRoomPrefab);
                    }
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (-1.0f, 0.0f);
                    break;

                case "R":
                    if (X == 0) {
                        roomObject = Instantiate (inLetRoomPrefab);
                    } else {
                        roomObject = Instantiate (outLetRoomPrefab);
                    }
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (1.0f, 0.0f);
                    break;

                case "D":
                    roomObject = Instantiate (inLetRoomPrefab);
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (0.0f, -1.0f);
                    break;

                case "U":
                    roomObject = Instantiate (inLetRoomPrefab);
                    roomObject.GetComponent<PhysicsRoom> ().constantVelocity = new Vector2 (0.0f, 1.0f);
                    break;

                case "S":
                    roomObject = Instantiate (safeRoomPrefab);
                    break;

                case "T":
                    roomObject = Instantiate (tabaccoinPhysicsRoomPrefab);
                    break;

                default:
                    roomObject = Instantiate (wallRoomPrefab);
                    break;
                }

                Vector3 newPosition = Vector3.zero;
                if (ROOM_MAX_X % 2 == 0)
                {

                newPosition = new Vector3(
                    (-(ROOM_MAX_X - 1) / 2 + X) * ROOM_SPRITE_LENGTH + transform.position.x - ROOM_SPRITE_LENGTH / 2,
                    (-(ROOM_MAX_Y - 1) / 2 + Y) * ROOM_SPRITE_LENGTH + transform.position.y - ROOM_SPRITE_LENGTH / 2,
                    1.0f
                );
                }
                else
                {
                newPosition = new Vector3(
                    (-(ROOM_MAX_X - 1) / 2 + X) * ROOM_SPRITE_LENGTH + transform.position.x,
                    (-(ROOM_MAX_Y - 1) / 2 + Y) * ROOM_SPRITE_LENGTH + transform.position.y,
                    1.0f
                );
                }

                roomObject.transform.localPosition = newPosition;
                roomObject.transform.SetParent(transform);
                roomObject.name = "Room(" + X.ToString() + " , " + Y.ToString() + ")";

                rooms [Y].Add (roomObject);

            }

        }

        return roomInformation;
    }