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
836db3d1
Commit
836db3d1
authored
Feb 04, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
생각보다 렉 안걸림
parent
f38d8a10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
26 deletions
+6
-26
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+0
-20
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+2
-2
TileManager.cs
Assets/Scripts/TileManager.cs
+4
-4
No files found.
Assets/Scripts/TetrisMap/MapManager.cs
View file @
836db3d1
...
@@ -216,25 +216,6 @@ public class MapManager : MonoBehaviour {
...
@@ -216,25 +216,6 @@ public class MapManager : MonoBehaviour {
* functions
* functions
* */
* */
/// <summary>
/// <summary>
/// Find and return object's child by child's name.
/// </summary>
/// <param name="parent">Parent object.</param>
/// <param name="name">Name of the child object you want to find.</param>
/// <returns></returns>
public
static
Transform
GetChildByName
(
Transform
parent
,
string
name
)
{
Transform
child
;
for
(
int
i
=
0
;
i
<
parent
.
childCount
;
i
++)
{
if
(
parent
.
GetChild
(
i
).
name
.
Equals
(
name
))
{
child
=
parent
.
GetChild
(
i
);
return
child
;
}
}
return
null
;
}
/// <summary>
/// Check if tetrimino is in right x coordinate.
/// Check if tetrimino is in right x coordinate.
/// </summary>
/// </summary>
/// <param name="te">-1 for over left end, 1 for over right end, 2 for over bottom end, 3 for already existing, 0 for right place.</param>
/// <param name="te">-1 for over left end, 1 for over right end, 2 for over bottom end, 3 for already existing, 0 for right place.</param>
...
@@ -733,7 +714,6 @@ public class MapManager : MonoBehaviour {
...
@@ -733,7 +714,6 @@ public class MapManager : MonoBehaviour {
if
(
Input
.
GetButtonDown
(
"TetriminoVertical"
))
if
(
Input
.
GetButtonDown
(
"TetriminoVertical"
))
{
{
TetriminoRotate
(
currentTetrimino
,
(
int
)
Input
.
GetAxisRaw
(
"TetriminoVertical"
));
TetriminoRotate
(
currentTetrimino
,
(
int
)
Input
.
GetAxisRaw
(
"TetriminoVertical"
));
}
}
else
if
(
Input
.
GetButtonDown
(
"TetriminoHorizontal"
)
&&
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
>
0
)
else
if
(
Input
.
GetButtonDown
(
"TetriminoHorizontal"
)
&&
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
>
0
)
{
{
...
...
Assets/Scripts/TetrisMap/Room.cs
View file @
836db3d1
...
@@ -120,7 +120,7 @@ public class Room : MonoBehaviour
...
@@ -120,7 +120,7 @@ public class Room : MonoBehaviour
public
void
CreateDoors
(
GameObject
_leftTetrisDoor
,
GameObject
_rightTetrisDoor
,
GameObject
_inGameDoorUp
,
GameObject
_inGameDoorDown
,
GameObject
_inGameDoorLeft
,
GameObject
_inGameDoorRight
)
public
void
CreateDoors
(
GameObject
_leftTetrisDoor
,
GameObject
_rightTetrisDoor
,
GameObject
_inGameDoorUp
,
GameObject
_inGameDoorDown
,
GameObject
_inGameDoorLeft
,
GameObject
_inGameDoorRight
)
{
{
float
standardSize
=
MapManager
.
tetrisMapSize
/
24
;
float
standardSize
=
MapManager
.
tetrisMapSize
/
24
;
Tilemap
wallTileMap
=
MapManager
.
GetChildByName
(
roomInGame
.
transform
,
"wall"
).
GetComponent
<
Tilemap
>();
Tilemap
wallTileMap
=
roomInGame
.
transform
.
Find
(
"wall"
).
GetComponent
<
Tilemap
>();
leftTetrisDoor
=
Instantiate
(
_leftTetrisDoor
,
transform
.
position
+
new
Vector3
(
standardSize
,
doorLocations
[
leftDoorLocation
],
0
),
Quaternion
.
identity
,
transform
);
leftTetrisDoor
=
Instantiate
(
_leftTetrisDoor
,
transform
.
position
+
new
Vector3
(
standardSize
,
doorLocations
[
leftDoorLocation
],
0
),
Quaternion
.
identity
,
transform
);
rightTetrisDoor
=
Instantiate
(
_rightTetrisDoor
,
transform
.
position
+
new
Vector3
(
standardSize
*
23
,
doorLocations
[
rightDoorLocation
],
0
),
Quaternion
.
identity
,
transform
);
rightTetrisDoor
=
Instantiate
(
_rightTetrisDoor
,
transform
.
position
+
new
Vector3
(
standardSize
*
23
,
doorLocations
[
rightDoorLocation
],
0
),
Quaternion
.
identity
,
transform
);
...
@@ -147,7 +147,7 @@ public class Room : MonoBehaviour
...
@@ -147,7 +147,7 @@ public class Room : MonoBehaviour
/// </summary>
/// </summary>
public
void
CreatePortal
()
public
void
CreatePortal
()
{
{
GameObject
portal
=
MapManager
.
GetChildByName
(
roomInGame
.
transform
,
"Portal"
).
gameObject
;
GameObject
portal
=
roomInGame
.
transform
.
Find
(
"Portal"
).
gameObject
;
if
(
specialRoomType
!=
RoomType
.
Normal
)
if
(
specialRoomType
!=
RoomType
.
Normal
)
{
{
portal
.
SetActive
(
true
);
portal
.
SetActive
(
true
);
...
...
Assets/Scripts/TileManager.cs
View file @
836db3d1
...
@@ -33,7 +33,7 @@ public class TileManager : MonoBehaviour
...
@@ -33,7 +33,7 @@ public class TileManager : MonoBehaviour
/// <param name="roomInGame">Room you want to check.</param>
/// <param name="roomInGame">Room you want to check.</param>
public
void
CheckAllTiles
(
RoomInGame
roomInGame
)
public
void
CheckAllTiles
(
RoomInGame
roomInGame
)
{
{
Tilemap
roomTileMap
=
MapManager
.
GetChildByName
(
roomInGame
.
transform
,
"wall"
).
GetComponent
<
Tilemap
>();
Tilemap
roomTileMap
=
roomInGame
.
transform
.
Find
(
"wall"
).
GetComponent
<
Tilemap
>();
for
(
int
x
=
0
;
x
<
24
;
x
++)
for
(
int
x
=
0
;
x
<
24
;
x
++)
for
(
int
y
=
0
;
y
<
24
;
y
++)
for
(
int
y
=
0
;
y
<
24
;
y
++)
{
{
...
@@ -102,12 +102,12 @@ public class TileManager : MonoBehaviour
...
@@ -102,12 +102,12 @@ public class TileManager : MonoBehaviour
int
stage
=
MapManager
.
currentStage
;
int
stage
=
MapManager
.
currentStage
;
//int concept = room.roomConcept;
//int concept = room.roomConcept;
int
concept
=
0
;
int
concept
=
0
;
Tilemap
roomTileMap
=
MapManager
.
GetChildByName
(
roomInGame
.
transform
,
"wall"
).
GetComponent
<
Tilemap
>();
Tilemap
roomTileMap
=
roomInGame
.
transform
.
Find
(
"wall"
).
GetComponent
<
Tilemap
>();
CheckAllTiles
(
roomInGame
);
CheckAllTiles
(
roomInGame
);
for
(
int
y
=
0
;
y
<
24
;
y
++)
for
(
int
y
=
0
;
y
<
24
;
y
++)
{
{
if
(
y
%
3
==
0
)
/*
if (y % 3 == 0)
yield
return
null
;
yield return null;
*/
for
(
int
x
=
0
;
x
<
24
;
x
++)
for
(
int
x
=
0
;
x
<
24
;
x
++)
{
{
if
(
roomInGame
.
tileInfo
[
x
,
y
])
if
(
roomInGame
.
tileInfo
[
x
,
y
])
...
...
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