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
5796d2ec
Commit
5796d2ec
authored
Feb 02, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 체력이 0이 되면 게임 오버, 클리어하지 않은 방 들어갈 때 몹 스폰함
parent
958700b5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
138 additions
and
62 deletions
+138
-62
TestTools.prefab
Assets/Prefabs/TetrisMap/TestTools.prefab
+6
-6
Player.cs
Assets/Scripts/Characters/Player.cs
+4
-1
MapManager.cs
Assets/Scripts/TetrisMap/MapManager.cs
+4
-0
Test.cs
Assets/Scripts/TetrisMap/Test.cs
+0
-53
TileManager.cs
Assets/Scripts/TileManager.cs
+110
-0
TileManager.cs.meta
Assets/Scripts/TileManager.cs.meta
+11
-0
LifeStoneManager.cs
...Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
+3
-2
No files found.
Assets/Prefabs/TetrisMap/TestTools.prefab
View file @
5796d2ec
...
@@ -1323,7 +1323,7 @@ RectTransform:
...
@@ -1323,7 +1323,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
19
0
,
y
:
140
}
m_AnchoredPosition
:
{
x
:
-30
0
,
y
:
140
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!224
&224363839195006936
---
!u!224
&224363839195006936
...
@@ -1387,7 +1387,7 @@ RectTransform:
...
@@ -1387,7 +1387,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
19
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
-30
0
,
y
:
0
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!224
&224527953610948652
---
!u!224
&224527953610948652
...
@@ -1460,7 +1460,7 @@ RectTransform:
...
@@ -1460,7 +1460,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
19
0
,
y
:
-70
}
m_AnchoredPosition
:
{
x
:
-30
0
,
y
:
-70
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!224
&224658872540831358
---
!u!224
&224658872540831358
...
@@ -1497,7 +1497,7 @@ RectTransform:
...
@@ -1497,7 +1497,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
19
0
,
y
:
280
}
m_AnchoredPosition
:
{
x
:
-30
0
,
y
:
280
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!224
&224718253185442684
---
!u!224
&224718253185442684
...
@@ -1552,7 +1552,7 @@ RectTransform:
...
@@ -1552,7 +1552,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
19
0
,
y
:
210
}
m_AnchoredPosition
:
{
x
:
-30
0
,
y
:
210
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!224
&224851610276147026
---
!u!224
&224851610276147026
...
@@ -1571,6 +1571,6 @@ RectTransform:
...
@@ -1571,6 +1571,6 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMin
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchorMax
:
{
x
:
0
,
y
:
0.5
}
m_AnchoredPosition
:
{
x
:
19
0
,
y
:
70
}
m_AnchoredPosition
:
{
x
:
-30
0
,
y
:
70
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_SizeDelta
:
{
x
:
200
,
y
:
50
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
Assets/Scripts/Characters/Player.cs
View file @
5796d2ec
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using
UnityEngine
;
using
UnityEngine
;
public
class
Player
:
MonoBehaviour
{
public
class
Player
:
MonoBehaviour
{
public
LifeStoneManager
LCUI
;
LifeStoneManager
lifeStoneManager
;
public
static
int
tx
,
ty
;
public
static
int
tx
,
ty
;
public
static
float
X
=
0.7f
,
Y
=
1.6f
;
public
static
float
X
=
0.7f
,
Y
=
1.6f
;
public
int
ttx
;
public
int
ttx
;
...
@@ -13,6 +13,7 @@ public class Player : MonoBehaviour {
...
@@ -13,6 +13,7 @@ public class Player : MonoBehaviour {
void
Start
()
{
void
Start
()
{
ttx
=
(
int
)(
transform
.
position
.
x
/
24f
);
ttx
=
(
int
)(
transform
.
position
.
x
/
24f
);
tty
=
(
int
)(
transform
.
position
.
y
-
0.9f
/
24f
);
tty
=
(
int
)(
transform
.
position
.
y
-
0.9f
/
24f
);
lifeStoneManager
=
GameObject
.
Find
(
"LifeStoneUI"
).
GetComponent
<
LifeStoneManager
>();
}
}
// Update is called once per frame
// Update is called once per frame
...
@@ -41,5 +42,7 @@ public class Player : MonoBehaviour {
...
@@ -41,5 +42,7 @@ public class Player : MonoBehaviour {
}
}
ttx
=
tx
;
ttx
=
tx
;
tty
=
ty
;
tty
=
ty
;
if
(
lifeStoneManager
.
CountType
(
LifeStoneType
.
Normal
)
==
0
)
GameManager
.
gameState
=
GameState
.
GameOver
;
}
}
}
}
Assets/Scripts/TetrisMap/MapManager.cs
View file @
5796d2ec
...
@@ -876,6 +876,10 @@ public class MapManager : MonoBehaviour {
...
@@ -876,6 +876,10 @@ public class MapManager : MonoBehaviour {
room
.
leftTetrisDoor
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
room
.
leftTetrisDoor
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
room
.
rightTetrisDoor
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
room
.
rightTetrisDoor
.
GetComponent
<
SpriteRenderer
>().
color
=
new
Color
(
1
,
1
,
1
,
0
);
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
)
{
GameObject
.
Find
(
"EnemyManager"
).
GetComponent
<
EnemyManager
>().
SpawnEnemy
();
}
}
}
/// <summary>
/// <summary>
/// Make room fade out.
/// Make room fade out.
...
...
Assets/Scripts/TetrisMap/Test.cs
View file @
5796d2ec
...
@@ -56,59 +56,6 @@ public class Test : MonoBehaviour {
...
@@ -56,59 +56,6 @@ public class Test : MonoBehaviour {
enemyManager
.
SpawnEnemy
();
enemyManager
.
SpawnEnemy
();
}
}
public
GameObject
upDoor
;
public
GameObject
downDoor
;
public
GameObject
leftDoor
;
public
GameObject
rightDoor
;
public
void
UpOpenTest
()
{
Animator
animator
=
upDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
true
);
animator
.
SetBool
(
"doorClose"
,
false
);
}
public
void
UpCloseTest
()
{
Animator
animator
=
upDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
false
);
animator
.
SetBool
(
"doorClose"
,
true
);
}
public
void
DownOpenTest
()
{
Animator
animator
=
downDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
true
);
animator
.
SetBool
(
"doorClose"
,
false
);
}
public
void
DownCloseTest
()
{
Animator
animator
=
downDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
false
);
animator
.
SetBool
(
"doorClose"
,
true
);
}
public
void
LeftOpenTest
()
{
Animator
animator
=
leftDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
true
);
animator
.
SetBool
(
"doorClose"
,
false
);
}
public
void
LeftCloseTest
()
{
Animator
animator
=
leftDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
false
);
animator
.
SetBool
(
"doorClose"
,
true
);
}
public
void
RightOpenTest
()
{
Animator
animator
=
rightDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
true
);
animator
.
SetBool
(
"doorClose"
,
false
);
}
public
void
RightCloseTest
()
{
Animator
animator
=
rightDoor
.
GetComponent
<
Animator
>();
animator
.
SetBool
(
"doorOpen"
,
false
);
animator
.
SetBool
(
"doorClose"
,
true
);
}
private
void
Awake
()
private
void
Awake
()
{
{
...
...
Assets/Scripts/TileManager.cs
0 → 100644
View file @
5796d2ec
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.Tilemaps
;
public
class
TileManager
:
MonoBehaviour
{
public
TileBase
[]
tileFR
;
public
TileBase
[]
tileIT
;
public
TileBase
[]
tileWW
;
public
TileBase
[]
tileUT
;
public
Tilemap
map
;
public
RoomInGame
roomInGame
;
public
TileBase
[]
fillLeftDoor
;
public
TileBase
[]
fillRightDoor
;
//기본 테마를 숲속 유적으로 하고 if(얼음신전)
public
void
Init
()
{
for
(
int
i
=
0
;
i
<
tileFR
.
Length
;
i
++)
map
.
SwapTile
(
tileFR
[
i
],
tileIT
[
i
]);
}
/*
같은 방식으로
if(수로)
for(int i=0;i<tileFR.Length;i++)
map.SwapTile(tileFR[i], tileWW[i]);
if(나무아래)
for(int i=0;i<tileFR.Length;i++)
map.SwapTile(tileFR[i], tileUT[i]);
*/
public
void
FillEmptyDoor
(
int
leftDoorLocation
,
int
rightDoorLocation
)
{
Tilemap
outerWallMap
=
roomInGame
.
transform
.
GetChild
(
4
).
GetComponent
<
Tilemap
>();
int
[]
doorLocations
=
{
1
,
9
,
17
};
for
(
int
i
=
0
;
i
<
3
;
i
++)
{
//경우를 따지자
/*
* 왼쪽의 경우
* 문 위 타일
* 1. 오른쪽에 타일이 없음 -> [| |] 모양 넣기 0
* 2. 오른쪽에만 타일이 있음 -> [| .] 모양 넣기 2
* 3. 오른쪽이랑 오른쪽 대각선 위에 타일이 있음 -> [| ] 모양 넣기 1
*
* 문 아래 타일
* 1. 오른쪽 타일 없음 -> 문 위랑 동일
* 2. 오른족에만 타일 -> [| '] 모양 넣기 3
* 3. 오른족이랑 오른쪽 대각선 아래에 타일 -> [| ] 모양
*
* 오른쪽의 경우
* 문 위 타일
* 1. 왼쪽에 X -> [| |]
* 2. 왼쪽에만 -> [. |]
* 3. 왼쪽이랑 왼쪽 대각선 아래 -> [ |]
*
* 문 아래
* 1. 왼쪽에 X -> [| |]
* 2. 왼쪽에만 -> [' |]
* 3. 왼쪽이랑 왼쪽 대각선 위 -> [ |]
*/
if
(
i
!=
leftDoorLocation
)
{
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
+
1
,
0
),
fillLeftDoor
[
0
]);
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
],
0
),
fillLeftDoor
[
0
]);
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
1
,
doorLocations
[
i
]
+
2
,
0
))
&&
outerWallMap
.
HasTile
(
new
Vector3Int
(
1
,
doorLocations
[
i
]
+
3
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
+
2
,
0
),
fillLeftDoor
[
1
]);
else
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
1
,
doorLocations
[
i
]
+
2
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
+
2
,
0
),
fillLeftDoor
[
2
]);
else
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
+
2
,
0
),
fillLeftDoor
[
0
]);
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
1
,
doorLocations
[
i
]
-
1
,
0
))
&&
outerWallMap
.
HasTile
(
new
Vector3Int
(
1
,
doorLocations
[
i
]
-
2
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
-
1
,
0
),
fillLeftDoor
[
1
]);
else
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
1
,
doorLocations
[
i
]
-
1
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
-
1
,
0
),
fillLeftDoor
[
3
]);
else
outerWallMap
.
SetTile
(
new
Vector3Int
(
0
,
doorLocations
[
i
]
-
1
,
0
),
fillLeftDoor
[
0
]);
}
if
(
i
!=
rightDoorLocation
)
{
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
+
1
,
0
),
fillRightDoor
[
0
]);
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
],
0
),
fillRightDoor
[
0
]);
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
22
,
doorLocations
[
i
]
+
2
,
0
))
&&
outerWallMap
.
HasTile
(
new
Vector3Int
(
22
,
doorLocations
[
i
]
+
3
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
+
2
,
0
),
fillRightDoor
[
1
]);
else
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
22
,
doorLocations
[
i
]
+
2
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
+
2
,
0
),
fillRightDoor
[
2
]);
else
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
+
2
,
0
),
fillRightDoor
[
0
]);
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
22
,
doorLocations
[
i
]
-
1
,
0
))
&&
outerWallMap
.
HasTile
(
new
Vector3Int
(
22
,
doorLocations
[
i
]
-
2
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
-
1
,
0
),
fillRightDoor
[
1
]);
else
if
(
outerWallMap
.
HasTile
(
new
Vector3Int
(
22
,
doorLocations
[
i
]
-
1
,
0
)))
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
-
1
,
0
),
fillRightDoor
[
3
]);
else
outerWallMap
.
SetTile
(
new
Vector3Int
(
23
,
doorLocations
[
i
]
-
1
,
0
),
fillRightDoor
[
0
]);
}
}
}
}
Assets/Scripts/TileManager.cs.meta
0 → 100644
View file @
5796d2ec
fileFormatVersion: 2
guid: adab373df646d5f4fb794a3b6ffdf2d7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/UI/In-game UI/LifeStoneScript/LifeStoneManager.cs
View file @
5796d2ec
...
@@ -63,8 +63,9 @@ public class LifeStoneManager : MonoBehaviour {
...
@@ -63,8 +63,9 @@ public class LifeStoneManager : MonoBehaviour {
lifeStoneArray
=
new
int
[
50
,
3
];
lifeStoneArray
=
new
int
[
50
,
3
];
lifeStoneUnit
=
new
GameObject
[
50
,
3
];
lifeStoneUnit
=
new
GameObject
[
50
,
3
];
for
(
int
i
=
0
;
i
<
50
;
i
++)
for
(
int
j
=
0
;
j
<
3
;
j
++)
lifeStoneArray
[
i
,
j
]
=
0
;
for
(
int
i
=
0
;
i
<
50
;
i
++)
for
(
int
j
=
0
;
j
<
3
;
j
++)
lifeStoneArray
[
i
,
j
]
=
0
;
StartCoroutine
(
"TestEnumerator"
);
//StartCoroutine("TestEnumerator");
}
PushLifeStone
(
new
LifeStoneInfo
(
new
Vector2Int
(
3
,
8
),
"AAAAAAAAAAAAAAAAAAAAAAAA"
));
}
IEnumerator
TestEnumerator
()
IEnumerator
TestEnumerator
()
{
{
yield
return
null
;
yield
return
null
;
...
...
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