Commit 2f808f24 authored by 18손재민's avatar 18손재민

테트리스 볼 때 방 내부 안보이게 고침

parent 507dd9fd
......@@ -163,17 +163,20 @@ public class CameraController : MonoBehaviour {
}
public void ChangeState()
{
GameObject grid = GameObject.Find("Grid");
if (Input.GetKeyDown(KeyCode.Tab) && GameManager.gameState == GameManager.GameState.Ingame)
{
GameManager.gameState = GameManager.GameState.Tetris;
tetrisCamera.GetComponent<Camera>().enabled = true;
mainCamera.GetComponent<Camera>().enabled = false;
grid.transform.position = new Vector3(0, 0, 2);
}
else if (Input.GetKeyDown(KeyCode.Tab) && GameManager.gameState == GameManager.GameState.Tetris)
{
GameManager.gameState = GameManager.GameState.Ingame;
tetrisCamera.GetComponent<Camera>().enabled = false;
mainCamera.GetComponent<Camera>().enabled = true;
grid.transform.position = new Vector3(0, 0, 0);
GotoDestination();
}
}
......
......@@ -632,11 +632,12 @@ public class MapManager : MonoBehaviour {
}
else
{
Instantiate(normalRoomsDistributed[te.rooms[i].leftDoorLocation, te.rooms[i].rightDoorLocation][Random.Range(0, normalRoomsDistributed[te.rooms[i].leftDoorLocation, te.rooms[i].rightDoorLocation].Count)],
te.rooms[i].transform.position + new Vector3(0, 0, 2), Quaternion.identity, te.rooms[i].transform);
te.rooms[i].CreateDoors(leftDoor, rightDoor);
int left = te.rooms[i].leftDoorLocation;
int right = te.rooms[i].rightDoorLocation;
Instantiate(normalRoomsDistributed[left, right][Random.Range(0, normalRoomsDistributed[left, right].Count)], te.rooms[i].transform.position + new Vector3(0, 0, 2),
Quaternion.identity, te.rooms[i].transform);
}
te.rooms[i].CreateDoors(leftDoor, rightDoor);
}
Destroy(te.gameObject);
}
......@@ -712,7 +713,6 @@ public class MapManager : MonoBehaviour {
yield return null;
}
camera.transform.localPosition = originPos;
Debug.Log("sd");
}
void Awake()
......@@ -726,13 +726,9 @@ public class MapManager : MonoBehaviour {
Tetrimino.rotationInformation[6].horizontalLength = new int[4] { 3, 2, 3, 2 }; //Z
Tetrimino.rotationInformation[7].horizontalLength = new int[4] { 1, 1, 1, 1 }; //Boss
for (int i = 0; i < tetrisYCoord.Length; i++)
{
tetrisYCoord[i] = i * tetrisMapSize;
}
for (int i = 0; i < isRowDeleting.Length; i++)
{
isRowDeleting[i] = false;
}
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
normalRoomsDistributed[i, j] = new List<RoomInGame>();
......@@ -747,12 +743,7 @@ public class MapManager : MonoBehaviour {
for (int right = rightDoor; right != 0; right /= 10)
{
if(left % 10 == 1 && right % 10 == 1)
{
Debug.Log(i + " : left " + leftCount + " right " + rightCount);
normalRoomsDistributed[leftCount, rightCount].Add(normalRoomList[i]);
//normalRoomsDistributed[leftCount, rightCount] = normalRoomList[i];
}
rightCount++;
}
rightCount = 0;
......@@ -760,7 +751,6 @@ public class MapManager : MonoBehaviour {
}
}
tetriminoSpawner = GameObject.Find("TetriminoSpawner").GetComponent<TetriminoSpawner>();
}
// Use this for initialization
......
......@@ -51,7 +51,7 @@ public class Room : MonoBehaviour
/// </summary>
public void CreateDoors(GameObject leftDoor, GameObject rightDoor)
{
Instantiate(leftDoor, transform.position + new Vector3(leftDoorLocation * 8 + 1, 0, 0), Quaternion.identity, transform);
Instantiate(rightDoor, transform.position + new Vector3(rightDoorLocation * 8 + 1, 0, 0), Quaternion.identity, transform);
Instantiate(leftDoor, transform.position + new Vector3(1, leftDoorLocation * 8 + 1, 0), Quaternion.identity, transform);
Instantiate(rightDoor, transform.position + new Vector3(23, rightDoorLocation * 8 + 1, 0), Quaternion.identity, transform);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment