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
926ba458
Commit
926ba458
authored
Feb 24, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
방 클리어하는 함수 새로 팜
parent
214fbfeb
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
462 additions
and
92 deletions
+462
-92
PlayScene.unity
Assets/Scenes/PlayScene.unity
+330
-0
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+36
-36
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+15
-20
RoomInGame.cs
Assets/Scripts/TetrisMap/RoomInGame.cs
+11
-23
BossRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/BossRoomInGame.cs
+7
-5
GoldRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/GoldRoomInGame.cs
+26
-4
ItemRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/ItemRoomInGame.cs
+31
-4
NormalRoomInGame.cs
Assets/Scripts/TetrisMap/Rooms/NormalRoomInGame.cs
+6
-0
No files found.
Assets/Scenes/PlayScene.unity
View file @
926ba458
This diff is collapsed.
Click to expand it.
Assets/Scripts/TetrisMap/MapManager.cs
View file @
926ba458
...
@@ -988,70 +988,70 @@ public class MapManager : Singleton<MapManager> {
...
@@ -988,70 +988,70 @@ public class MapManager : Singleton<MapManager> {
Tetrimino
.
rotationInformation
[
5
].
horizontalLength
=
new
int
[
4
]
{
3
,
2
,
3
,
2
};
//S
Tetrimino
.
rotationInformation
[
5
].
horizontalLength
=
new
int
[
4
]
{
3
,
2
,
3
,
2
};
//S
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
ItemRoomInGame
.
itemRoomInformation
[
0
]
=
new
RoomItemInfo
(
ItemRoomInGame
.
itemRoomInformation
[
0
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>
(
new
Item
Spawn
Info
[
8
]
new
Item
RoomItem
Info
[
8
]
{
{
new
Item
Spawn
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
}),
new
Item
Spawn
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
}),
new
Item
Spawn
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Gold
},
new
int
[
2
]
{
1
,
1
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Gold
},
new
int
[
2
]
{
1
,
1
}),
new
Item
Spawn
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
12.5f
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Gold
},
new
int
[
2
]
{
1
,
1
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Gold
},
new
int
[
2
]
{
1
,
1
}),
new
Item
Spawn
Info
(
17
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
},
new
Item
RoomItem
Info
(
17
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Ordinary
},
new
int
[
2
]
{
1
,
1
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Ordinary
},
new
int
[
2
]
{
1
,
1
}),
new
Item
Spawn
Info
(
25
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
},
new
Item
RoomItem
Info
(
25
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Study
},
new
int
[
2
]
{
1
,
1
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Ordinary
,
ItemQuality
.
Study
},
new
int
[
2
]
{
1
,
1
}),
new
Item
Spawn
Info
(
4
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Item
},
new
Item
RoomItem
Info
(
4
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Item
},
new
ItemQuality
[
1
]
{
ItemQuality
.
Superior
},
new
int
[
1
]
{
1
}),
new
ItemQuality
[
1
]
{
ItemQuality
.
Superior
},
new
int
[
1
]
{
1
}),
new
Item
Spawn
Info
(
4
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Addon
},
new
Item
RoomItem
Info
(
4
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Addon
},
new
ItemQuality
[
1
]
{
ItemQuality
.
Superior
},
new
int
[
1
]
{
1
})
new
ItemQuality
[
1
]
{
ItemQuality
.
Superior
},
new
int
[
1
]
{
1
})
});
});
ItemRoomInGame
.
itemRoomInformation
[
1
]
=
new
RoomItemInfo
(
ItemRoomInGame
.
itemRoomInformation
[
1
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>
(
new
Item
Spawn
Info
[
7
]
new
Item
RoomItem
Info
[
7
]
{
{
new
Item
Spawn
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
}),
new
Item
Spawn
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
}),
new
Item
Spawn
Info
(
20
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Addon
},
new
Item
RoomItem
Info
(
20
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Addon
},
new
ItemQuality
[
3
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
Study
},
new
int
[
3
]
{
1
,
1
,
1
}),
new
ItemQuality
[
3
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
Study
},
new
int
[
3
]
{
1
,
1
,
1
}),
new
Item
Spawn
Info
(
20
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
},
new
Item
RoomItem
Info
(
20
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Study
},
new
int
[
2
]
{
1
,
2
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Study
},
new
int
[
2
]
{
1
,
2
}),
new
Item
Spawn
Info
(
20
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
20
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
3
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
3
]
{
1
,
1
,
1
}),
new
ItemQuality
[
3
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
3
]
{
1
,
1
,
1
}),
new
Item
Spawn
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
}),
new
Item
Spawn
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
10
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
})
new
ItemQuality
[
2
]
{
ItemQuality
.
Superior
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
3
})
});
});
ItemRoomInGame
.
itemRoomInformation
[
2
]
=
new
RoomItemInfo
(
ItemRoomInGame
.
itemRoomInformation
[
2
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>
(
new
Item
Spawn
Info
[
4
]
new
Item
RoomItem
Info
[
4
]
{
{
new
Item
Spawn
Info
(
33.5f
,
new
ItemSpawnType
[
4
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
33.5f
,
new
ItemSpawnType
[
4
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
4
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
4
]
{
1
,
1
,
1
,
1
}),
new
ItemQuality
[
4
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
4
]
{
1
,
1
,
1
,
1
}),
new
Item
Spawn
Info
(
33.5f
,
new
ItemSpawnType
[
4
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
33.5f
,
new
ItemSpawnType
[
4
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
4
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
4
]
{
1
,
1
,
1
,
1
}),
new
ItemQuality
[
4
]
{
ItemQuality
.
Superior
,
ItemQuality
.
Superior
,
ItemQuality
.
Ordinary
,
ItemQuality
.
None
},
new
int
[
4
]
{
1
,
1
,
1
,
1
}),
new
Item
Spawn
Info
(
16.5f
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Item
},
new
Item
RoomItem
Info
(
16.5f
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Item
},
new
ItemQuality
[
1
]
{
ItemQuality
.
Masterpiece
},
new
int
[
1
]
{
1
}),
new
ItemQuality
[
1
]
{
ItemQuality
.
Masterpiece
},
new
int
[
1
]
{
1
}),
new
Item
Spawn
Info
(
16.5f
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Addon
},
new
Item
RoomItem
Info
(
16.5f
,
new
ItemSpawnType
[
1
]
{
ItemSpawnType
.
Addon
},
new
ItemQuality
[
1
]
{
ItemQuality
.
Masterpiece
},
new
int
[
1
]
{
1
})
new
ItemQuality
[
1
]
{
ItemQuality
.
Masterpiece
},
new
int
[
1
]
{
1
})
});
});
ItemRoomInGame
.
itemRoomInformation
[
3
]
=
new
RoomItemInfo
(
ItemRoomInGame
.
itemRoomInformation
[
3
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>
(
new
Item
Spawn
Info
[
2
]
new
Item
RoomItem
Info
[
2
]
{
{
new
Item
Spawn
Info
(
50
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
50
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
}),
new
ItemQuality
[
2
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
}),
new
Item
Spawn
Info
(
50
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
Item
RoomItem
Info
(
50
,
new
ItemSpawnType
[
2
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
GoldPotion
},
new
ItemQuality
[
2
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
})
new
ItemQuality
[
2
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
},
new
int
[
2
]
{
1
,
2
})
});
});
ItemRoomInGame
.
itemRoomInformation
[
4
]
=
new
RoomItemInfo
(
ItemRoomInGame
.
itemRoomInformation
[
4
]
=
new
RoomItemInfo
<
ItemRoomItemInfo
>
(
new
Item
Spawn
Info
[
2
]
new
Item
RoomItem
Info
[
2
]
{
{
new
Item
Spawn
Info
(
50
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
LifeStoneFrame
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
50
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Item
,
ItemSpawnType
.
LifeStoneFrame
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
3
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
,
ItemQuality
.
Gold
},
new
int
[
3
]
{
1
,
1
,
1
}),
new
ItemQuality
[
3
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
,
ItemQuality
.
Gold
},
new
int
[
3
]
{
1
,
1
,
1
}),
new
Item
Spawn
Info
(
50
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStoneFrame
,
ItemSpawnType
.
LifeStone
},
new
Item
RoomItem
Info
(
50
,
new
ItemSpawnType
[
3
]
{
ItemSpawnType
.
Addon
,
ItemSpawnType
.
LifeStoneFrame
,
ItemSpawnType
.
LifeStone
},
new
ItemQuality
[
3
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
,
ItemQuality
.
Gold
},
new
int
[
3
]
{
1
,
1
,
1
})
new
ItemQuality
[
3
]
{
ItemQuality
.
Masterpiece
,
ItemQuality
.
None
,
ItemQuality
.
Gold
},
new
int
[
3
]
{
1
,
1
,
1
})
});
});
for
(
int
i
=
0
;
i
<
tetrisYCoord
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
tetrisYCoord
.
Length
;
i
++)
...
@@ -1229,7 +1229,7 @@ public class MapManager : Singleton<MapManager> {
...
@@ -1229,7 +1229,7 @@ public class MapManager : Singleton<MapManager> {
if
(
GameManager
.
gameState
==
GameState
.
Portal
)
if
(
GameManager
.
gameState
==
GameState
.
Portal
)
PortalControl
();
PortalControl
();
if
(!
currentRoom
.
isRoomCleared
&&
(
EnemyManager
.
Instance
.
IsClear
()
||
(
currentRoom
.
specialRoomType
!=
RoomType
.
Normal
&&
currentRoom
.
specialRoomType
!=
RoomType
.
Boss
)))
if
(!
currentRoom
.
isRoomCleared
&&
(
EnemyManager
.
Instance
.
IsClear
()
||
(
currentRoom
.
specialRoomType
!=
RoomType
.
Normal
&&
currentRoom
.
specialRoomType
!=
RoomType
.
Boss
)))
currentRoom
.
Clear
Room
();
currentRoom
.
Finish
Room
();
}
}
}
}
}
}
Assets/Scripts/TetrisMap/Room.cs
View file @
926ba458
...
@@ -221,6 +221,19 @@ public class Room : MonoBehaviour
...
@@ -221,6 +221,19 @@ public class Room : MonoBehaviour
{
{
portal
=
roomInGame
.
transform
.
Find
(
"portal spot"
).
gameObject
;
portal
=
roomInGame
.
transform
.
Find
(
"portal spot"
).
gameObject
;
portal
=
Instantiate
(
MapManager
.
Instance
.
portal
,
portal
.
transform
.
position
,
Quaternion
.
identity
,
roomInGame
.
transform
);
portal
=
Instantiate
(
MapManager
.
Instance
.
portal
,
portal
.
transform
.
position
,
Quaternion
.
identity
,
roomInGame
.
transform
);
for
(
int
x
=
0
;
x
<
MapManager
.
width
;
x
++)
MapManager
.
portalDistributedHorizontal
[
x
].
Clear
();
for
(
int
y
=
0
;
y
<=
MapManager
.
realHeight
;
y
++)
MapManager
.
portalDistributedVertical
[
y
].
Clear
();
for
(
int
x
=
0
;
x
<
MapManager
.
width
;
x
++)
for
(
int
y
=
0
;
y
<=
MapManager
.
realHeight
;
y
++)
if
(
MapManager
.
mapGrid
[
x
,
y
]
!=
null
&&
MapManager
.
mapGrid
[
x
,
y
].
isPortal
==
true
)
{
MapManager
.
portalGrid
[
x
,
y
]
=
true
;
MapManager
.
portalDistributedHorizontal
[
x
].
Add
(
y
);
MapManager
.
portalDistributedVertical
[
y
].
Add
(
x
);
}
portalSurface
=
Instantiate
(
MapManager
.
Instance
.
portalSurface
,
transform
.
position
+
new
Vector3
(
12
,
12
,
0
),
Quaternion
.
identity
,
transform
);
}
}
}
}
}
}
...
@@ -366,7 +379,7 @@ public class Room : MonoBehaviour
...
@@ -366,7 +379,7 @@ public class Room : MonoBehaviour
/// Clear the cleared room.
/// Clear the cleared room.
/// Open all the doors and change fog to cleared fog.
/// Open all the doors and change fog to cleared fog.
/// </summary>
/// </summary>
public
void
Clear
Room
()
public
void
Finish
Room
()
{
{
if
(
isRoomCleared
!=
true
)
if
(
isRoomCleared
!=
true
)
{
{
...
@@ -375,32 +388,14 @@ public class Room : MonoBehaviour
...
@@ -375,32 +388,14 @@ public class Room : MonoBehaviour
OpenDoor
(
"Left"
);
OpenDoor
(
"Left"
);
OpenDoor
(
"Right"
);
OpenDoor
(
"Right"
);
Vector3
fogPosition
=
fog
.
transform
.
position
;
Vector3
fogPosition
=
fog
.
transform
.
position
;
Destroy
(
fog
);
fog
=
Instantiate
(
MapManager
.
Instance
.
clearedFog
,
fogPosition
,
Quaternion
.
identity
,
transform
);
fog
=
Instantiate
(
MapManager
.
Instance
.
clearedFog
,
fogPosition
,
Quaternion
.
identity
,
transform
);
fog
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
fog
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
CreatePortal
();
CreatePortal
();
if
(
isPortal
==
true
)
{
for
(
int
x
=
0
;
x
<
MapManager
.
width
;
x
++)
MapManager
.
portalDistributedHorizontal
[
x
].
Clear
();
for
(
int
y
=
0
;
y
<=
MapManager
.
realHeight
;
y
++)
MapManager
.
portalDistributedVertical
[
y
].
Clear
();
for
(
int
x
=
0
;
x
<
MapManager
.
width
;
x
++)
for
(
int
y
=
0
;
y
<=
MapManager
.
realHeight
;
y
++)
if
(
MapManager
.
mapGrid
[
x
,
y
]
!=
null
&&
MapManager
.
mapGrid
[
x
,
y
].
isPortal
==
true
)
{
MapManager
.
portalGrid
[
x
,
y
]
=
true
;
MapManager
.
portalDistributedHorizontal
[
x
].
Add
(
y
);
MapManager
.
portalDistributedVertical
[
y
].
Add
(
x
);
}
portalSurface
=
Instantiate
(
MapManager
.
Instance
.
portalSurface
,
transform
.
position
+
new
Vector3
(
12
,
12
,
0
),
Quaternion
.
identity
,
transform
);
}
isRoomCleared
=
true
;
isRoomCleared
=
true
;
MapManager
.
Instance
.
clock
.
clockSpeedStack
-=
3
;
MapManager
.
Instance
.
clock
.
clockSpeedStack
-=
3
;
if
(
MapManager
.
Instance
.
clock
.
clockSpeedStack
<
0
)
if
(
MapManager
.
Instance
.
clock
.
clockSpeedStack
<
0
)
MapManager
.
Instance
.
clock
.
clockSpeedStack
=
0
;
MapManager
.
Instance
.
clock
.
clockSpeedStack
=
0
;
if
(
specialRoomType
==
RoomType
.
Boss
)
roomInGame
.
RoomClear
();
MapManager
.
currentStage
+=
1
;
}
}
//Need to make extra works.
//Need to make extra works.
}
}
...
...
Assets/Scripts/TetrisMap/RoomInGame.cs
View file @
926ba458
...
@@ -2,31 +2,14 @@
...
@@ -2,31 +2,14 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
public
class
ItemSpawnInfo
public
class
RoomItemInfo
<
T
>
{
{
public
float
probability
;
public
List
<
T
>
itemSpawnInfo
=
new
List
<
T
>();
public
ItemSpawnType
[]
itemType
;
public
RoomItemInfo
()
public
ItemQuality
[]
itemQuality
;
{
public
int
[]
amount
;
public
ItemSpawnInfo
(
float
_probability
,
ItemSpawnType
[]
_itemType
,
ItemQuality
[]
_itemQuality
,
int
[]
_amount
)
{
probability
=
_probability
;
itemType
=
new
ItemSpawnType
[
_itemType
.
Length
];
itemQuality
=
new
ItemQuality
[
_itemQuality
.
Length
];
amount
=
new
int
[
4
];
for
(
int
i
=
0
;
i
<
_itemType
.
Length
;
i
++)
{
itemType
[
i
]
=
_itemType
[
i
];
itemQuality
[
i
]
=
_itemQuality
[
i
];
amount
[
i
]
=
_amount
[
i
];
}
}
}
public
class
RoomItemInfo
}
{
public
RoomItemInfo
(
T
[]
_itemSpawnInfo
)
public
List
<
ItemSpawnInfo
>
itemSpawnInfo
=
new
List
<
ItemSpawnInfo
>();
public
RoomItemInfo
(
ItemSpawnInfo
[]
_itemSpawnInfo
)
{
{
for
(
int
i
=
0
;
i
<
_itemSpawnInfo
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
_itemSpawnInfo
.
Length
;
i
++)
itemSpawnInfo
.
Add
(
_itemSpawnInfo
[
i
]);
itemSpawnInfo
.
Add
(
_itemSpawnInfo
[
i
]);
...
@@ -63,4 +46,9 @@ public class RoomInGame : MonoBehaviour {
...
@@ -63,4 +46,9 @@ public class RoomInGame : MonoBehaviour {
{
{
}
}
public
virtual
void
RoomClear
()
{
}
}
}
Assets/Scripts/TetrisMap/Rooms/BossRoomInGame.cs
View file @
926ba458
...
@@ -4,14 +4,16 @@ using UnityEngine;
...
@@ -4,14 +4,16 @@ using UnityEngine;
public
class
BossRoomInGame
:
RoomInGame
{
public
class
BossRoomInGame
:
RoomInGame
{
IEnumerator
[]
phases
;
public
override
void
RoomEnter
()
public
override
void
RoomEnter
()
{
{
base
.
RoomEnter
();
base
.
RoomEnter
();
// 보스 소개
//보스 만들어지면 구현할 것
}
}
public
override
void
RoomClear
()
{
base
.
RoomClear
();
MapManager
.
currentStage
+=
1
;
}
}
}
Assets/Scripts/TetrisMap/Rooms/GoldRoomInGame.cs
View file @
926ba458
...
@@ -2,17 +2,39 @@
...
@@ -2,17 +2,39 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
public
class
GoldRoomInGame
:
RoomInGame
{
public
class
GoldRoomItemInfo
{
public
ItemSpawnType
[]
itemType
;
public
ItemQuality
[]
itemQuality
;
public
int
[]
price
;
public
GoldRoomItemInfo
(
ItemSpawnType
[]
_itemType
,
ItemQuality
[]
_itemQuality
,
int
[]
_price
)
{
itemType
=
new
ItemSpawnType
[
_itemType
.
Length
];
itemQuality
=
new
ItemQuality
[
_itemQuality
.
Length
];
price
=
new
int
[
_price
.
Length
];
for
(
int
i
=
0
;
i
<
_itemType
.
Length
;
i
++)
{
itemType
[
i
]
=
_itemType
[
i
];
itemQuality
[
i
]
=
_itemQuality
[
i
];
price
[
i
]
=
_price
[
i
];
}
}
}
public
class
GoldRoomInGame
:
RoomInGame
{
public
static
RoomItemInfo
<
GoldRoomItemInfo
>[]
goldRoomInformation
=
new
RoomItemInfo
<
GoldRoomItemInfo
>()[];
public
override
void
RoomEnter
()
public
override
void
RoomEnter
()
{
{
base
.
RoomEnter
();
base
.
RoomEnter
();
}
}
public
override
void
RoomClear
()
{
base
.
RoomClear
();
}
}
}
Assets/Scripts/TetrisMap/Rooms/ItemRoomInGame.cs
View file @
926ba458
...
@@ -2,11 +2,32 @@
...
@@ -2,11 +2,32 @@
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine
;
public
class
ItemRoomItemInfo
{
public
float
probability
;
public
ItemSpawnType
[]
itemType
;
public
ItemQuality
[]
itemQuality
;
public
int
[]
amount
;
public
ItemRoomItemInfo
(
float
_probability
,
ItemSpawnType
[]
_itemType
,
ItemQuality
[]
_itemQuality
,
int
[]
_amount
)
{
probability
=
_probability
;
itemType
=
new
ItemSpawnType
[
_itemType
.
Length
];
itemQuality
=
new
ItemQuality
[
_itemQuality
.
Length
];
amount
=
new
int
[
_amount
.
Length
];
for
(
int
i
=
0
;
i
<
_itemType
.
Length
;
i
++)
{
itemType
[
i
]
=
_itemType
[
i
];
itemQuality
[
i
]
=
_itemQuality
[
i
];
amount
[
i
]
=
_amount
[
i
];
}
}
}
public
class
ItemRoomInGame
:
RoomInGame
{
public
class
ItemRoomInGame
:
RoomInGame
{
public
static
RoomItemInfo
[]
itemRoomInformation
=
new
RoomItemInfo
[
5
];
public
void
SpawnItem
()
public
static
RoomItemInfo
<
ItemRoomItemInfo
>[]
itemRoomInformation
=
new
RoomItemInfo
<
ItemRoomItemInfo
>[
5
];
public
void
SpawnItem
()
{
{
Room
room
=
transform
.
parent
.
GetComponent
<
Room
>();
Room
room
=
transform
.
parent
.
GetComponent
<
Room
>();
InventoryManager
inventoryManager
=
InventoryManager
.
Instance
;
InventoryManager
inventoryManager
=
InventoryManager
.
Instance
;
...
@@ -21,7 +42,7 @@ public class ItemRoomInGame : RoomInGame {
...
@@ -21,7 +42,7 @@ public class ItemRoomInGame : RoomInGame {
itemRoomIndex
=
5
;
itemRoomIndex
=
5
;
for
(
int
index
=
0
;
index
<
itemRoomInformation
[
itemRoomIndex
-
1
].
itemSpawnInfo
.
Count
;
index
++)
for
(
int
index
=
0
;
index
<
itemRoomInformation
[
itemRoomIndex
-
1
].
itemSpawnInfo
.
Count
;
index
++)
{
{
Item
Spawn
Info
child
=
itemRoomInformation
[
itemRoomIndex
-
1
].
itemSpawnInfo
[
index
];
Item
RoomItem
Info
child
=
itemRoomInformation
[
itemRoomIndex
-
1
].
itemSpawnInfo
[
index
];
probability
-=
child
.
probability
;
probability
-=
child
.
probability
;
Debug
.
Log
(
probability
);
Debug
.
Log
(
probability
);
if
(
probability
<=
0
)
if
(
probability
<=
0
)
...
@@ -86,4 +107,10 @@ public class ItemRoomInGame : RoomInGame {
...
@@ -86,4 +107,10 @@ public class ItemRoomInGame : RoomInGame {
base
.
RoomEnter
();
base
.
RoomEnter
();
SpawnItem
();
SpawnItem
();
}
}
public
override
void
RoomClear
()
{
base
.
RoomClear
();
}
}
}
Assets/Scripts/TetrisMap/Rooms/NormalRoomInGame.cs
View file @
926ba458
...
@@ -9,4 +9,10 @@ public class NormalRoomInGame : RoomInGame {
...
@@ -9,4 +9,10 @@ public class NormalRoomInGame : RoomInGame {
base
.
RoomEnter
();
base
.
RoomEnter
();
EnemyManager
.
Instance
.
SpawnEnemyToMap
();
EnemyManager
.
Instance
.
SpawnEnemyToMap
();
}
}
public
override
void
RoomClear
()
{
base
.
RoomClear
();
}
}
}
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