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
36e10cf3
Commit
36e10cf3
authored
Jan 05, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
방 생성할 때 양 옆에 방이 있으면 문 어디 뚫릴지 정보 저장함
parent
1215823d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
10 deletions
+40
-10
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+1
-6
Room.cs
Assets/Scripts/TetrisMap/Room.cs
+37
-3
RoomInGame.cs
Assets/Scripts/TetrisMap/RoomInGame.cs
+2
-1
No files found.
Assets/Scripts/TetrisMap/MapManager.cs
View file @
36e10cf3
...
...
@@ -109,10 +109,6 @@ public class MapManager : MonoBehaviour {
/// List for the normal Room candidates.
/// </summary>
public
RoomInGame
[]
normalRoomList
;
/*/// <summary>
/// List for the item Room candidates.
/// </summary>
public RoomInGame[] itemRoomList;*/
/// <summary>
/// Array for the special Room candidates.
/// </summary>
...
...
@@ -638,6 +634,7 @@ public class MapManager : MonoBehaviour {
{
Instantiate
(
normalRoomList
[
Random
.
Range
(
0
,
normalRoomList
.
Length
)],
te
.
rooms
[
i
].
transform
.
position
+
new
Vector3
(
0
,
0
,
2
),
Quaternion
.
identity
,
te
.
rooms
[
i
].
transform
);
}
te
.
rooms
[
i
].
SetDoors
();
}
Destroy
(
te
.
gameObject
);
}
...
...
@@ -706,7 +703,6 @@ public class MapManager : MonoBehaviour {
//transform.localPosition = new Vector3(Random.insideUnitCircle.x * amount + originPos.x, originPos.y, originPos.z);
//transform.localPosition = new Vector3(originPos.x, Random.insideUnitCircle.y * amount + originPos.y, originPos.z);
amount
-=
_amount
/
40
;
//Debug.Log(amount);
yield
return
null
;
}
camera
.
transform
.
localPosition
=
originPos
;
...
...
@@ -752,7 +748,6 @@ public class MapManager : MonoBehaviour {
currentGhost
.
transform
.
position
=
new
Vector3
(
currentGhost
.
mapCoord
.
x
*
tetrisMapSize
,
tetrisYCoord
[(
int
)
currentGhost
.
mapCoord
.
y
],
currentGhost
.
mapCoord
.
z
*
tetrisMapSize
);
}
}
//currentTetrimino.transform.position = currentTetrimino.mapCoord * tetrisMapSize + tetrisMapCoord;
}
}
...
...
Assets/Scripts/TetrisMap/Room.cs
View file @
36e10cf3
...
...
@@ -2,6 +2,20 @@
using
System.Collections.Generic
;
using
UnityEngine
;
class
Door
{
/// <summary>
/// Door info of left door.
/// 0 for lowest door, 1 for middle door, 2 for highest door.
/// </summary>
public
int
left
;
/// <summary>
/// Door info of right door.
/// 0 for lowest door, 1 for middle door, 2 for highest door.
/// </summary>
public
int
right
;
}
/// <summary>
/// Room class
/// </summary>
...
...
@@ -17,10 +31,11 @@ public class Room : MonoBehaviour
/// 0 for up, 1 for down.
/// doorInfo[0] for left door, doorInfo[1] for right door.
/// </summary>
public
int
[]
doorInfo
;
//public int[] doorInfo;
Door
doorInfo
=
new
Door
();
/// <summary>
/// Stage per rooms.
/// Range from 0 to 4.
/// </summary>
public
int
stage
;
/// <summary>
...
...
@@ -38,11 +53,30 @@ public class Room : MonoBehaviour
/// </summary>
public
MapManager
.
SpecialRoomType
specialRoomType
;
public
int
testLeft
;
public
int
testRight
;
/// <summary>
/// Select which doors would be opened.
/// </summary>
public
void
SetDoors
()
{
if
(
mapCoord
.
x
<
MapManager
.
width
-
1
&&
MapManager
.
mapGrid
[(
int
)
mapCoord
.
x
+
1
,
(
int
)
mapCoord
.
y
]
!=
null
)
{
doorInfo
.
right
=
MapManager
.
mapGrid
[(
int
)
mapCoord
.
x
+
1
,
(
int
)
mapCoord
.
y
].
doorInfo
.
left
;
}
else
{
doorInfo
.
right
=
Random
.
Range
(
0
,
3
);
}
if
(
mapCoord
.
x
>
0
&&
MapManager
.
mapGrid
[(
int
)
mapCoord
.
x
-
1
,
(
int
)
mapCoord
.
y
]
!=
null
)
{
doorInfo
.
left
=
MapManager
.
mapGrid
[(
int
)
mapCoord
.
x
-
1
,
(
int
)
mapCoord
.
y
].
doorInfo
.
right
;
}
else
{
doorInfo
.
left
=
Random
.
Range
(
0
,
3
);
}
testLeft
=
doorInfo
.
left
;
testRight
=
doorInfo
.
right
;
}
}
Assets/Scripts/TetrisMap/RoomInGame.cs
View file @
36e10cf3
...
...
@@ -5,7 +5,8 @@ using UnityEngine;
public
class
RoomInGame
:
MonoBehaviour
{
/// <summary>
/// The enum for door information.
/// The enum for
/// information.
/// </summary>
public
DoorInfo
doorInfo
;
public
enum
DoorInfo
{
None
,
Left
,
Right
,
Both
};
...
...
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