private MazeRoom CreateMazeRoom(BlockData data, int direction, int col, int row) { MazeRoom room = new MazeRoom(); room.Data = data; room.Direction = direction; room.Col = col; room.Row = row; return room; }
private void CreateMockRoom(MazeRoom room) { float cubeSize = GlobalConfig.BlockConfig.MockCubeSize; GameObject cube = ResourceManager.Instance.LoadGameObject(ObjectType.GameObject, GlobalConfig.BlockConfig.MockRoomPath); cube.transform.localScale = new Vector3(room.Data.Cols * cubeSize, 0.1f, room.Data.Rows * cubeSize); cube.transform.localEulerAngles = Vector3.up * 90f * room.Direction; cube.transform.position = new Vector3(room.Col * cubeSize , GlobalConfig.BlockConfig.MockBlockPosY, room.Row * cubeSize); cube.transform.parent = RootTransform.Instance.MockBlockRoot; cube.transform.position = cube.transform.position - cube.transform.forward * GlobalConfig.BlockConfig.MockLinkSize * 0.5f; cube.GetComponentInChildren<MeshRenderer>().material.mainTextureScale = new Vector2(room.Data.Cols, room.Data.Rows); cube.GetComponent<Sparking>().IsEnabled = room.ExplorationType != ExplorationType.Common; }