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
89543963
Commit
89543963
authored
Feb 08, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tetris'
parents
5a75d803
1d9e784a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
301 additions
and
51 deletions
+301
-51
Room Item 1-1.prefab
Assets/Prefabs/Rooms/SpecialRoom/Room Item 1-1.prefab
+88
-38
Room Item.prefab
Assets/Prefabs/Rooms/SpecialRoom/Room Item.prefab
+81
-2
CameraController.cs
Assets/Scripts/CameraController.cs
+2
-2
GameManager.cs
Assets/Scripts/GameManager.cs
+1
-1
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+128
-7
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+1
-1
No files found.
Assets/Prefabs/Rooms/SpecialRoom/Room Item 1-1.prefab
View file @
89543963
...
@@ -307,20 +307,6 @@ CompositeCollider2D:
...
@@ -307,20 +307,6 @@ CompositeCollider2D:
m_ColliderPaths
:
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883505704759332
}
-
m_Collider
:
{
fileID
:
2113883505704759332
}
m_ColliderPaths
:
m_ColliderPaths
:
-
-
X
:
240000000
Y
:
239843744
-
X
:
239843744
Y
:
240000000
-
X
:
130000000
Y
:
240000000
-
X
:
130000000
Y
:
230000000
-
X
:
230000000
Y
:
230000000
-
X
:
230000000
Y
:
190000000
-
X
:
240000000
Y
:
190000000
-
-
X
:
10000000
-
-
X
:
10000000
Y
:
230000000
Y
:
230000000
-
X
:
110000000
-
X
:
110000000
...
@@ -335,6 +321,20 @@ CompositeCollider2D:
...
@@ -335,6 +321,20 @@ CompositeCollider2D:
Y
:
190000000
Y
:
190000000
-
X
:
10000000
-
X
:
10000000
Y
:
190000000
Y
:
190000000
-
-
X
:
240000000
Y
:
239843744
-
X
:
239843744
Y
:
240000000
-
X
:
130000000
Y
:
240000000
-
X
:
130000000
Y
:
230000000
-
X
:
230000000
Y
:
230000000
-
X
:
230000000
Y
:
190000000
-
X
:
240000000
Y
:
190000000
-
-
X
:
240000000
-
-
X
:
240000000
Y
:
170000000
Y
:
170000000
-
X
:
230000000
-
X
:
230000000
...
@@ -367,16 +367,6 @@ CompositeCollider2D:
...
@@ -367,16 +367,6 @@ CompositeCollider2D:
Y
:
30000000
Y
:
30000000
-
X
:
10000000
-
X
:
10000000
Y
:
30000000
Y
:
30000000
-
-
X
:
240000000
Y
:
9843750
-
X
:
239843744
Y
:
10000000
-
X
:
130000000
Y
:
10000000
-
X
:
130000000
Y
:
0
-
X
:
240000000
Y
:
0
-
-
X
:
110000000
-
-
X
:
110000000
Y
:
9843750
Y
:
9843750
-
X
:
109843752
-
X
:
109843752
...
@@ -387,15 +377,18 @@ CompositeCollider2D:
...
@@ -387,15 +377,18 @@ CompositeCollider2D:
Y
:
0
Y
:
0
-
X
:
110000000
-
X
:
110000000
Y
:
0
Y
:
0
-
-
X
:
240000000
Y
:
9843750
-
X
:
239843744
Y
:
10000000
-
X
:
130000000
Y
:
10000000
-
X
:
130000000
Y
:
0
-
X
:
240000000
Y
:
0
m_CompositePaths
:
m_CompositePaths
:
m_Paths
:
m_Paths
:
-
-
{
x
:
24
,
y
:
23.984375
}
-
{
x
:
23.984375
,
y
:
24
}
-
{
x
:
13
,
y
:
24
}
-
{
x
:
13
,
y
:
23
}
-
{
x
:
23
,
y
:
23
}
-
{
x
:
23
,
y
:
19
}
-
{
x
:
24
,
y
:
19
}
-
-
{
x
:
1
,
y
:
23
}
-
-
{
x
:
1
,
y
:
23
}
-
{
x
:
11
,
y
:
23
}
-
{
x
:
11
,
y
:
23
}
-
{
x
:
11
,
y
:
23.984375
}
-
{
x
:
11
,
y
:
23.984375
}
...
@@ -403,6 +396,13 @@ CompositeCollider2D:
...
@@ -403,6 +396,13 @@ CompositeCollider2D:
-
{
x
:
0
,
y
:
24
}
-
{
x
:
0
,
y
:
24
}
-
{
x
:
0
,
y
:
19
}
-
{
x
:
0
,
y
:
19
}
-
{
x
:
1
,
y
:
19
}
-
{
x
:
1
,
y
:
19
}
-
-
{
x
:
24
,
y
:
23.984375
}
-
{
x
:
23.984375
,
y
:
24
}
-
{
x
:
13
,
y
:
24
}
-
{
x
:
13
,
y
:
23
}
-
{
x
:
23
,
y
:
23
}
-
{
x
:
23
,
y
:
19
}
-
{
x
:
24
,
y
:
19
}
-
-
{
x
:
24
,
y
:
17
}
-
-
{
x
:
24
,
y
:
17
}
-
{
x
:
23
,
y
:
17
}
-
{
x
:
23
,
y
:
17
}
-
{
x
:
23
,
y
:
11
}
-
{
x
:
23
,
y
:
11
}
...
@@ -419,16 +419,16 @@ CompositeCollider2D:
...
@@ -419,16 +419,16 @@ CompositeCollider2D:
-
{
x
:
0
,
y
:
9
}
-
{
x
:
0
,
y
:
9
}
-
{
x
:
0
,
y
:
3
}
-
{
x
:
0
,
y
:
3
}
-
{
x
:
1
,
y
:
3
}
-
{
x
:
1
,
y
:
3
}
-
-
{
x
:
24
,
y
:
0.984375
}
-
{
x
:
23.984375
,
y
:
1
}
-
{
x
:
13
,
y
:
1
}
-
{
x
:
13
,
y
:
0
}
-
{
x
:
24
,
y
:
0
}
-
-
{
x
:
11
,
y
:
0.984375
}
-
-
{
x
:
11
,
y
:
0.984375
}
-
{
x
:
10.984375
,
y
:
1
}
-
{
x
:
10.984375
,
y
:
1
}
-
{
x
:
0
,
y
:
1
}
-
{
x
:
0
,
y
:
1
}
-
{
x
:
0
,
y
:
0
}
-
{
x
:
0
,
y
:
0
}
-
{
x
:
11
,
y
:
0
}
-
{
x
:
11
,
y
:
0
}
-
-
{
x
:
24
,
y
:
0.984375
}
-
{
x
:
23.984375
,
y
:
1
}
-
{
x
:
13
,
y
:
1
}
-
{
x
:
13
,
y
:
0
}
-
{
x
:
24
,
y
:
0
}
m_VertexDistance
:
0.0005
m_VertexDistance
:
0.0005
---
!u!66
&66776817046886398
---
!u!66
&66776817046886398
CompositeCollider2D
:
CompositeCollider2D
:
...
@@ -934,9 +934,59 @@ CompositeCollider2D:
...
@@ -934,9 +934,59 @@ CompositeCollider2D:
m_GeometryType
:
0
m_GeometryType
:
0
m_GenerationType
:
0
m_GenerationType
:
0
m_EdgeRadius
:
0
m_EdgeRadius
:
0
m_ColliderPaths
:
[]
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883506822126360
}
m_ColliderPaths
:
-
-
X
:
60000000
Y
:
210000000
-
X
:
50000000
Y
:
210000000
-
X
:
50000000
Y
:
206406256
-
X
:
60000000
Y
:
206406256
-
-
X
:
190000000
Y
:
210000000
-
X
:
180000000
Y
:
210000000
-
X
:
180000000
Y
:
206406256
-
X
:
190000000
Y
:
206406256
-
-
X
:
40000000
Y
:
80000000
-
X
:
30000000
Y
:
80000000
-
X
:
30000000
Y
:
76406248
-
X
:
40000000
Y
:
76406248
-
-
X
:
210000000
Y
:
80000000
-
X
:
200000000
Y
:
80000000
-
X
:
200000000
Y
:
76406248
-
X
:
210000000
Y
:
76406248
m_CompositePaths
:
m_CompositePaths
:
m_Paths
:
[]
m_Paths
:
-
-
{
x
:
6
,
y
:
21
}
-
{
x
:
5
,
y
:
21
}
-
{
x
:
5
,
y
:
20.640625
}
-
{
x
:
6
,
y
:
20.640625
}
-
-
{
x
:
19
,
y
:
21
}
-
{
x
:
18
,
y
:
21
}
-
{
x
:
18
,
y
:
20.640625
}
-
{
x
:
19
,
y
:
20.640625
}
-
-
{
x
:
4
,
y
:
8
}
-
{
x
:
3
,
y
:
8
}
-
{
x
:
3
,
y
:
7.640625
}
-
{
x
:
4
,
y
:
7.640625
}
-
-
{
x
:
21
,
y
:
8
}
-
{
x
:
20
,
y
:
8
}
-
{
x
:
20
,
y
:
7.640625
}
-
{
x
:
21
,
y
:
7.640625
}
m_VertexDistance
:
0.0005
m_VertexDistance
:
0.0005
---
!u!114
&114875551757596772
---
!u!114
&114875551757596772
MonoBehaviour
:
MonoBehaviour
:
...
...
Assets/Prefabs/Rooms/SpecialRoom/Room Item.prefab
View file @
89543963
...
@@ -70,6 +70,21 @@ GameObject:
...
@@ -70,6 +70,21 @@ GameObject:
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
1
---
!u!1
&1326135493854760
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
4855720522592534
}
m_Layer
:
0
m_Name
:
ItemSpawnPoint
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!1
&1370955136548852
---
!u!1
&1370955136548852
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -224,9 +239,23 @@ Transform:
...
@@ -224,9 +239,23 @@ Transform:
-
{
fileID
:
4552797671095560
}
-
{
fileID
:
4552797671095560
}
-
{
fileID
:
4628846653152418
}
-
{
fileID
:
4628846653152418
}
-
{
fileID
:
4507596403279470
}
-
{
fileID
:
4507596403279470
}
-
{
fileID
:
4855720522592534
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!4
&4855720522592534
Transform
:
m_ObjectHideFlags
:
1
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInternal
:
{
fileID
:
100100000
}
m_GameObject
:
{
fileID
:
1326135493854760
}
m_LocalRotation
:
{
x
:
-0
,
y
:
-0
,
z
:
-0
,
w
:
1
}
m_LocalPosition
:
{
x
:
12
,
y
:
15
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Father
:
{
fileID
:
4721597541747138
}
m_RootOrder
:
6
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!4
&4988769571006008
---
!u!4
&4988769571006008
Transform
:
Transform
:
m_ObjectHideFlags
:
1
m_ObjectHideFlags
:
1
...
@@ -849,9 +878,59 @@ CompositeCollider2D:
...
@@ -849,9 +878,59 @@ CompositeCollider2D:
m_GeometryType
:
0
m_GeometryType
:
0
m_GenerationType
:
0
m_GenerationType
:
0
m_EdgeRadius
:
0
m_EdgeRadius
:
0
m_ColliderPaths
:
[]
m_ColliderPaths
:
-
m_Collider
:
{
fileID
:
2113883505166204504
}
m_ColliderPaths
:
-
-
X
:
60000000
Y
:
210000000
-
X
:
50000000
Y
:
210000000
-
X
:
50000000
Y
:
206406256
-
X
:
60000000
Y
:
206406256
-
-
X
:
190000000
Y
:
210000000
-
X
:
180000000
Y
:
210000000
-
X
:
180000000
Y
:
206406256
-
X
:
190000000
Y
:
206406256
-
-
X
:
40000000
Y
:
80000000
-
X
:
30000000
Y
:
80000000
-
X
:
30000000
Y
:
76406248
-
X
:
40000000
Y
:
76406248
-
-
X
:
210000000
Y
:
80000000
-
X
:
200000000
Y
:
80000000
-
X
:
200000000
Y
:
76406248
-
X
:
210000000
Y
:
76406248
m_CompositePaths
:
m_CompositePaths
:
m_Paths
:
[]
m_Paths
:
-
-
{
x
:
6
,
y
:
21
}
-
{
x
:
5
,
y
:
21
}
-
{
x
:
5
,
y
:
20.640625
}
-
{
x
:
6
,
y
:
20.640625
}
-
-
{
x
:
19
,
y
:
21
}
-
{
x
:
18
,
y
:
21
}
-
{
x
:
18
,
y
:
20.640625
}
-
{
x
:
19
,
y
:
20.640625
}
-
-
{
x
:
4
,
y
:
8
}
-
{
x
:
3
,
y
:
8
}
-
{
x
:
3
,
y
:
7.640625
}
-
{
x
:
4
,
y
:
7.640625
}
-
-
{
x
:
21
,
y
:
8
}
-
{
x
:
20
,
y
:
8
}
-
{
x
:
20
,
y
:
7.640625
}
-
{
x
:
21
,
y
:
7.640625
}
m_VertexDistance
:
0.0005
m_VertexDistance
:
0.0005
---
!u!66
&66477191110675372
---
!u!66
&66477191110675372
CompositeCollider2D
:
CompositeCollider2D
:
...
...
Assets/Scripts/CameraController.cs
View file @
89543963
...
@@ -76,7 +76,7 @@ public class CameraController : MonoBehaviour {
...
@@ -76,7 +76,7 @@ public class CameraController : MonoBehaviour {
if
(
gameState
==
GameState
.
Ingame
)
if
(
gameState
==
GameState
.
Ingame
)
{
{
GameManager
.
gameState
=
GameState
.
Ingame
;
GameManager
.
gameState
=
GameState
.
Ingame
;
StartCoroutine
(
mapManager
.
Room
FadeIn
(
MapManager
.
currentRoom
));
StartCoroutine
(
mapManager
.
Room
Enter
(
MapManager
.
currentRoom
));
grid
.
transform
.
position
=
new
Vector3
(
0
,
0
,
0
);
grid
.
transform
.
position
=
new
Vector3
(
0
,
0
,
0
);
sizeDestination
=
inGameCameraSize
;
sizeDestination
=
inGameCameraSize
;
while
(
GetComponent
<
Camera
>().
orthographicSize
>
sizeDestination
+
0.01
)
while
(
GetComponent
<
Camera
>().
orthographicSize
>
sizeDestination
+
0.01
)
...
@@ -97,7 +97,7 @@ public class CameraController : MonoBehaviour {
...
@@ -97,7 +97,7 @@ public class CameraController : MonoBehaviour {
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
].
portalSurface
.
GetComponent
<
SpriteRenderer
>().
sprite
=
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
].
portalSurface
.
GetComponent
<
SpriteRenderer
>().
sprite
=
GameObject
.
Find
(
"MapManager"
).
GetComponent
<
MapManager
>().
portalSelected
;
GameObject
.
Find
(
"MapManager"
).
GetComponent
<
MapManager
>().
portalSelected
;
}
}
StartCoroutine
(
mapManager
.
Room
FadeOu
t
(
MapManager
.
currentRoom
));
StartCoroutine
(
mapManager
.
Room
Exi
t
(
MapManager
.
currentRoom
));
grid
.
transform
.
position
=
new
Vector3
(
0
,
0
,
2
);
grid
.
transform
.
position
=
new
Vector3
(
0
,
0
,
2
);
sizeDestination
=
tetrisCameraSize
;
sizeDestination
=
tetrisCameraSize
;
while
(
GetComponent
<
Camera
>().
orthographicSize
<
sizeDestination
-
2
)
while
(
GetComponent
<
Camera
>().
orthographicSize
<
sizeDestination
-
2
)
...
...
Assets/Scripts/GameManager.cs
View file @
89543963
...
@@ -59,7 +59,7 @@ public class GameManager : MonoBehaviour {
...
@@ -59,7 +59,7 @@ public class GameManager : MonoBehaviour {
gameState
=
GameState
.
Ingame
;
gameState
=
GameState
.
Ingame
;
}
}
}
}
else
if
(
Input
.
Get
KeyDown
(
KeyCode
.
F
))
else
if
(
Input
.
Get
ButtonDown
(
"Interaction"
))
{
{
if
(
gameState
==
GameState
.
Portal
&&
MapManager
.
currentRoom
!=
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
])
if
(
gameState
==
GameState
.
Portal
&&
MapManager
.
currentRoom
!=
MapManager
.
mapGrid
[(
int
)
MapManager
.
portalDestination
.
x
,
(
int
)
MapManager
.
portalDestination
.
y
])
{
{
...
...
Assets/Scripts/TetrisMap/MapManager.cs
View file @
89543963
...
@@ -715,12 +715,12 @@ public class MapManager : MonoBehaviour {
...
@@ -715,12 +715,12 @@ public class MapManager : MonoBehaviour {
{
{
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
)
>
=
tetriminoCost
)
{
{
MoveTetriminoHorizontal
(
currentTetrimino
,
new
Vector3
((
int
)
Input
.
GetAxisRaw
(
"TetriminoHorizontal"
),
0
,
0
));
MoveTetriminoHorizontal
(
currentTetrimino
,
new
Vector3
((
int
)
Input
.
GetAxisRaw
(
"TetriminoHorizontal"
),
0
,
0
));
lifeStoneManager
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
tetriminoCost
);
lifeStoneManager
.
ChangeToNormal
(
LifeStoneType
.
Gold
,
tetriminoCost
);
}
}
else
if
(
Input
.
GetKeyDown
(
KeyCode
.
Space
)
&&
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
>
0
)
else
if
(
Input
.
GetKeyDown
(
KeyCode
.
Space
)
&&
lifeStoneManager
.
CountType
(
LifeStoneType
.
Gold
)
>
=
tetriminoCost
)
{
{
isTetriminoFalling
=
true
;
isTetriminoFalling
=
true
;
TetriminoMapCoordDown
(
currentTetrimino
);
TetriminoMapCoordDown
(
currentTetrimino
);
...
@@ -846,13 +846,13 @@ public class MapManager : MonoBehaviour {
...
@@ -846,13 +846,13 @@ public class MapManager : MonoBehaviour {
public
void
ChangeRoom
(
Room
newRoom
)
public
void
ChangeRoom
(
Room
newRoom
)
{
{
Room
room
=
currentRoom
;
Room
room
=
currentRoom
;
StartCoroutine
(
Room
FadeOu
t
(
room
));
StartCoroutine
(
Room
Exi
t
(
room
));
if
(
room
.
specialRoomType
==
RoomType
.
Normal
)
if
(
room
.
specialRoomType
==
RoomType
.
Normal
)
room
.
GetComponent
<
SpriteRenderer
>().
sprite
=
roomsSpritesDistributed
[
room
.
stage
][(
int
)
RoomSpriteType
.
Normal1
+
room
.
roomConcept
];
room
.
GetComponent
<
SpriteRenderer
>().
sprite
=
roomsSpritesDistributed
[
room
.
stage
][(
int
)
RoomSpriteType
.
Normal1
+
room
.
roomConcept
];
else
else
room
.
GetComponent
<
SpriteRenderer
>().
sprite
=
roomsSpritesDistributed
[
room
.
stage
][(
int
)
room
.
specialRoomType
];
room
.
GetComponent
<
SpriteRenderer
>().
sprite
=
roomsSpritesDistributed
[
room
.
stage
][(
int
)
room
.
specialRoomType
];
currentRoom
=
newRoom
;
currentRoom
=
newRoom
;
StartCoroutine
(
Room
FadeIn
(
newRoom
));
StartCoroutine
(
Room
Enter
(
newRoom
));
newRoom
.
GetComponent
<
SpriteRenderer
>().
sprite
=
roomsSpritesDistributed
[
newRoom
.
stage
][(
int
)
RoomSpriteType
.
Current
];
newRoom
.
GetComponent
<
SpriteRenderer
>().
sprite
=
roomsSpritesDistributed
[
newRoom
.
stage
][(
int
)
RoomSpriteType
.
Current
];
}
}
/// <summary>
/// <summary>
...
@@ -860,7 +860,7 @@ public class MapManager : MonoBehaviour {
...
@@ -860,7 +860,7 @@ public class MapManager : MonoBehaviour {
/// </summary>
/// </summary>
/// <param name="room">Room you want to fade in.</param>
/// <param name="room">Room you want to fade in.</param>
/// <returns></returns>
/// <returns></returns>
public
IEnumerator
Room
FadeIn
(
Room
room
)
public
IEnumerator
Room
Enter
(
Room
room
)
{
{
float
alpha
=
1
;
float
alpha
=
1
;
for
(
int
i
=
0
;
i
<
20
;
i
++)
for
(
int
i
=
0
;
i
<
20
;
i
++)
...
@@ -878,7 +878,128 @@ public class MapManager : MonoBehaviour {
...
@@ -878,7 +878,128 @@ public class MapManager : MonoBehaviour {
room
.
fog
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
room
.
fog
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
if
(!
room
.
isRoomCleared
)
if
(!
room
.
isRoomCleared
)
{
{
GameObject
.
Find
(
"EnemyManager"
).
GetComponent
<
EnemyManager
>().
SpawnEnemy
();
//GameObject.Find("EnemyManager").GetComponent<EnemyManager>().SpawnEnemy();
InventoryManager
inventoryManager
=
GameObject
.
Find
(
"InventoryManager"
).
GetComponent
<
InventoryManager
>();
LifeStoneManager
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>();
if
(
room
.
specialRoomType
==
RoomType
.
Item
)
{
int
probability
=
Random
.
Range
(
0
,
100
);
Vector3
itemPosition
=
room
.
roomInGame
.
transform
.
Find
(
"ItemSpawnPoint"
).
position
;
switch
(
room
.
itemRoomType
)
{
case
1
:
if
(
probability
<
25
)
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
}
else
if
(
25
<=
probability
&&
probability
<
50
)
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiateDroppedLifeStone
(
4
,
1
,
0
,
itemPosition
,
1
);
}
else
if
(
50
<=
probability
&&
probability
<
67
)
{
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
}
else
if
(
67
<=
probability
&&
probability
<
92
)
{
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Study
,
itemPosition
,
1
);
}
else
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
}
break
;
case
2
:
if
(
probability
%
5
==
0
)
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
}
else
if
(
probability
%
5
==
1
)
{
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Study
,
itemPosition
,
1
);
}
else
if
(
probability
%
5
==
2
)
{
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Study
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Study
,
itemPosition
,
1
);
}
else
if
(
probability
%
5
==
3
)
{
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiateDroppedLifeStone
(
3
,
0
,
0
,
itemPosition
,
1
);
}
else
if
(
probability
%
5
==
4
)
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiateDroppedLifeStone
(
3
,
0
,
0
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiateDroppedLifeStone
(
3
,
0
,
0
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiateDroppedLifeStone
(
3
,
0
,
0
,
itemPosition
,
1
);
}
break
;
case
3
:
if
(
probability
<
67
)
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Ordinary
,
itemPosition
,
1
);
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Superior
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
}
else
{
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Masterpiece
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Masterpiece
,
itemPosition
,
1
);
}
break
;
case
4
:
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Masterpiece
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Masterpiece
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
lifeStoneManager
.
InstantiatePotion
(
itemPosition
,
1
);
break
;
default
:
if
(
probability
%
2
==
0
)
inventoryManager
.
ItemInstantiate
(
ItemQuality
.
Masterpiece
,
itemPosition
,
1
);
else
inventoryManager
.
AddonInstantiate
(
ItemQuality
.
Masterpiece
,
itemPosition
,
1
);
lifeStoneManager
.
InstantiateDroppedLifeStone
(
3
*
room
.
itemRoomType
-
4
,
0
,
0
,
itemPosition
,
1
);
lifeStoneManager
.
ExpandRow
(
room
.
itemRoomType
-
4
);
break
;
}
}
}
}
}
}
/// <summary>
/// <summary>
...
@@ -886,7 +1007,7 @@ public class MapManager : MonoBehaviour {
...
@@ -886,7 +1007,7 @@ public class MapManager : MonoBehaviour {
/// </summary>
/// </summary>
/// <param name="room">Room you want to fade out.</param>
/// <param name="room">Room you want to fade out.</param>
/// <returns></returns>
/// <returns></returns>
public
IEnumerator
Room
FadeOu
t
(
Room
room
)
public
IEnumerator
Room
Exi
t
(
Room
room
)
{
{
float
alpha
=
0
;
float
alpha
=
0
;
for
(
int
i
=
0
;
i
<
20
;
i
++)
for
(
int
i
=
0
;
i
<
20
;
i
++)
...
...
Assets/Scripts/TetrisMap/Room.cs
View file @
89543963
...
@@ -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
=
roomInGame
.
transform
.
Find
(
"Portal"
).
gameObject
;
portal
=
roomInGame
.
transform
.
Find
(
"Portal"
).
gameObject
;
if
(
specialRoomType
!=
RoomType
.
Normal
)
if
(
specialRoomType
!=
RoomType
.
Normal
)
{
{
portal
.
SetActive
(
true
);
portal
.
SetActive
(
true
);
...
...
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