Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
2f808f24
Commit
2f808f24
authored
Jan 06, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
테트리스 볼 때 방 내부 안보이게 고침
parent
507dd9fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
17 deletions
+10
-17
CameraController.cs
Assets/Scripts/CameraController.cs
+3
-0
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+5
-15
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+2
-2
No files found.
Assets/Scripts/CameraController.cs
View file @
2f808f24
...
@@ -163,17 +163,20 @@ public class CameraController : MonoBehaviour {
...
@@ -163,17 +163,20 @@ public class CameraController : MonoBehaviour {
}
}
public
void
ChangeState
()
public
void
ChangeState
()
{
{
GameObject
grid
=
GameObject
.
Find
(
"Grid"
);
if
(
Input
.
GetKeyDown
(
KeyCode
.
Tab
)
&&
GameManager
.
gameState
==
GameManager
.
GameState
.
Ingame
)
if
(
Input
.
GetKeyDown
(
KeyCode
.
Tab
)
&&
GameManager
.
gameState
==
GameManager
.
GameState
.
Ingame
)
{
{
GameManager
.
gameState
=
GameManager
.
GameState
.
Tetris
;
GameManager
.
gameState
=
GameManager
.
GameState
.
Tetris
;
tetrisCamera
.
GetComponent
<
Camera
>().
enabled
=
true
;
tetrisCamera
.
GetComponent
<
Camera
>().
enabled
=
true
;
mainCamera
.
GetComponent
<
Camera
>().
enabled
=
false
;
mainCamera
.
GetComponent
<
Camera
>().
enabled
=
false
;
grid
.
transform
.
position
=
new
Vector3
(
0
,
0
,
2
);
}
}
else
if
(
Input
.
GetKeyDown
(
KeyCode
.
Tab
)
&&
GameManager
.
gameState
==
GameManager
.
GameState
.
Tetris
)
else
if
(
Input
.
GetKeyDown
(
KeyCode
.
Tab
)
&&
GameManager
.
gameState
==
GameManager
.
GameState
.
Tetris
)
{
{
GameManager
.
gameState
=
GameManager
.
GameState
.
Ingame
;
GameManager
.
gameState
=
GameManager
.
GameState
.
Ingame
;
tetrisCamera
.
GetComponent
<
Camera
>().
enabled
=
false
;
tetrisCamera
.
GetComponent
<
Camera
>().
enabled
=
false
;
mainCamera
.
GetComponent
<
Camera
>().
enabled
=
true
;
mainCamera
.
GetComponent
<
Camera
>().
enabled
=
true
;
grid
.
transform
.
position
=
new
Vector3
(
0
,
0
,
0
);
GotoDestination
();
GotoDestination
();
}
}
}
}
...
...
Assets/Scripts/TetrisMap/MapManager.cs
View file @
2f808f24
...
@@ -632,11 +632,12 @@ public class MapManager : MonoBehaviour {
...
@@ -632,11 +632,12 @@ public class MapManager : MonoBehaviour {
}
}
else
else
{
{
Instantiate
(
normalRoomsDistributed
[
te
.
rooms
[
i
].
leftDoorLocation
,
te
.
rooms
[
i
].
rightDoorLocation
][
Random
.
Range
(
0
,
normalRoomsDistributed
[
te
.
rooms
[
i
].
leftDoorLocation
,
te
.
rooms
[
i
].
rightDoorLocation
].
Count
)],
int
left
=
te
.
rooms
[
i
].
leftDoorLocation
;
te
.
rooms
[
i
].
transform
.
position
+
new
Vector3
(
0
,
0
,
2
),
Quaternion
.
identity
,
te
.
rooms
[
i
].
transform
);
int
right
=
te
.
rooms
[
i
].
rightDoorLocation
;
te
.
rooms
[
i
].
CreateDoors
(
leftDoor
,
rightDoor
);
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
);
Destroy
(
te
.
gameObject
);
}
}
...
@@ -712,7 +713,6 @@ public class MapManager : MonoBehaviour {
...
@@ -712,7 +713,6 @@ public class MapManager : MonoBehaviour {
yield
return
null
;
yield
return
null
;
}
}
camera
.
transform
.
localPosition
=
originPos
;
camera
.
transform
.
localPosition
=
originPos
;
Debug
.
Log
(
"sd"
);
}
}
void
Awake
()
void
Awake
()
...
@@ -726,13 +726,9 @@ public class MapManager : MonoBehaviour {
...
@@ -726,13 +726,9 @@ public class MapManager : MonoBehaviour {
Tetrimino
.
rotationInformation
[
6
].
horizontalLength
=
new
int
[
4
]
{
3
,
2
,
3
,
2
};
//Z
Tetrimino
.
rotationInformation
[
6
].
horizontalLength
=
new
int
[
4
]
{
3
,
2
,
3
,
2
};
//Z
Tetrimino
.
rotationInformation
[
7
].
horizontalLength
=
new
int
[
4
]
{
1
,
1
,
1
,
1
};
//Boss
Tetrimino
.
rotationInformation
[
7
].
horizontalLength
=
new
int
[
4
]
{
1
,
1
,
1
,
1
};
//Boss
for
(
int
i
=
0
;
i
<
tetrisYCoord
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
tetrisYCoord
.
Length
;
i
++)
{
tetrisYCoord
[
i
]
=
i
*
tetrisMapSize
;
tetrisYCoord
[
i
]
=
i
*
tetrisMapSize
;
}
for
(
int
i
=
0
;
i
<
isRowDeleting
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
isRowDeleting
.
Length
;
i
++)
{
isRowDeleting
[
i
]
=
false
;
isRowDeleting
[
i
]
=
false
;
}
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
j
=
0
;
j
<
3
;
j
++)
for
(
int
j
=
0
;
j
<
3
;
j
++)
normalRoomsDistributed
[
i
,
j
]
=
new
List
<
RoomInGame
>();
normalRoomsDistributed
[
i
,
j
]
=
new
List
<
RoomInGame
>();
...
@@ -747,12 +743,7 @@ public class MapManager : MonoBehaviour {
...
@@ -747,12 +743,7 @@ public class MapManager : MonoBehaviour {
for
(
int
right
=
rightDoor
;
right
!=
0
;
right
/=
10
)
for
(
int
right
=
rightDoor
;
right
!=
0
;
right
/=
10
)
{
{
if
(
left
%
10
==
1
&&
right
%
10
==
1
)
if
(
left
%
10
==
1
&&
right
%
10
==
1
)
{
Debug
.
Log
(
i
+
" : left "
+
leftCount
+
" right "
+
rightCount
);
normalRoomsDistributed
[
leftCount
,
rightCount
].
Add
(
normalRoomList
[
i
]);
normalRoomsDistributed
[
leftCount
,
rightCount
].
Add
(
normalRoomList
[
i
]);
//normalRoomsDistributed[leftCount, rightCount] = normalRoomList[i];
}
rightCount
++;
rightCount
++;
}
}
rightCount
=
0
;
rightCount
=
0
;
...
@@ -760,7 +751,6 @@ public class MapManager : MonoBehaviour {
...
@@ -760,7 +751,6 @@ public class MapManager : MonoBehaviour {
}
}
}
}
tetriminoSpawner
=
GameObject
.
Find
(
"TetriminoSpawner"
).
GetComponent
<
TetriminoSpawner
>();
tetriminoSpawner
=
GameObject
.
Find
(
"TetriminoSpawner"
).
GetComponent
<
TetriminoSpawner
>();
}
}
// Use this for initialization
// Use this for initialization
...
...
Assets/Scripts/TetrisMap/Room.cs
View file @
2f808f24
...
@@ -51,7 +51,7 @@ public class Room : MonoBehaviour
...
@@ -51,7 +51,7 @@ public class Room : MonoBehaviour
/// </summary>
/// </summary>
public
void
CreateDoors
(
GameObject
leftDoor
,
GameObject
rightDoor
)
public
void
CreateDoors
(
GameObject
leftDoor
,
GameObject
rightDoor
)
{
{
Instantiate
(
leftDoor
,
transform
.
position
+
new
Vector3
(
leftDoorLocation
*
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
(
rightDoorLocation
*
8
+
1
,
0
,
0
),
Quaternion
.
identity
,
transform
);
Instantiate
(
rightDoor
,
transform
.
position
+
new
Vector3
(
23
,
rightDoorLocation
*
8
+
1
,
0
),
Quaternion
.
identity
,
transform
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment