Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
man-in-the-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MIM
man-in-the-mirror
Commits
5c8e1c1c
Commit
5c8e1c1c
authored
Jul 03, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
게임 오버 및 재시작 wip, 현재 게임 오버 되면 맵이 그냥 삭제됨
parent
d37db3d0
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
4 deletions
+31
-4
2019-07-02-13-21-35.json.meta
Assets/2019-07-02-13-21-35.json.meta
+7
-0
EmptyMap.prefab
Assets/Prefabs/EmptyMap.prefab
+0
-0
EmptyMap.prefab.meta
Assets/Prefabs/EmptyMap.prefab.meta
+0
-0
MapManager.prefab
Assets/Prefabs/MapManager.prefab
+2
-2
CameraTurret.cs
Assets/Scripts/Interactors/CameraTurret.cs
+2
-1
GameManager.cs
Assets/Scripts/Managers/GameManager.cs
+18
-0
MapManager.cs
Assets/Scripts/Managers/MapManager.cs
+2
-1
No files found.
Assets/2019-07-02-13-21-35.json.meta
0 → 100644
View file @
5c8e1c1c
fileFormatVersion: 2
guid: 782c2a74f38e2544797cc7d82d6e01d5
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Prefabs/Empty
Stage
.prefab
→
Assets/Prefabs/Empty
Map
.prefab
View file @
5c8e1c1c
File moved
Assets/Prefabs/Empty
Stage
.prefab.meta
→
Assets/Prefabs/Empty
Map
.prefab.meta
View file @
5c8e1c1c
File moved
Assets/Prefabs/MapManager.prefab
View file @
5c8e1c1c
...
...
@@ -45,8 +45,8 @@ MonoBehaviour:
m_EditorClassIdentifier
:
isMapEditingOn
:
0
surface
:
{
fileID
:
0
}
currentMap
:
{
fileID
:
630498074781569474
,
guid
:
759f352c81f1b5a40b2d8d241cdf273b
,
type
:
3
}
currentMap
:
{
fileID
:
0
}
emptyMap
:
{
fileID
:
630498074781569474
,
guid
:
759f352c81f1b5a40b2d8d241cdf273b
,
type
:
3
}
floor
:
{
fileID
:
19711883686801522
,
guid
:
71931eea896a59a4683986cfd369b8ee
,
type
:
3
}
normalWall
:
{
fileID
:
2953616027608884528
,
guid
:
a4dcd71ec9f819f4e88c7b5ac24f4b0d
,
type
:
3
}
...
...
Assets/Scripts/Interactors/CameraTurret.cs
View file @
5c8e1c1c
...
...
@@ -33,7 +33,8 @@ public class CameraTurret : MonoBehaviour, IObject, IBreakable, IPlayerInteracto
{
if
(
Position
.
IsInAdjacentArea
(
pos
,
1
)
&&
MapManager
.
inst
.
currentMap
.
GetWallAtPos
((
Vector2
)(
Position
+
pos
)
/
2
)
==
null
)
{
Debug
.
Log
(
Position
.
x
+
" "
+
Position
.
y
+
" Stage Restart!"
);
StartCoroutine
(
GameManager
.
inst
.
GameOver
());
//TODO : Restart Level
}
}
...
...
Assets/Scripts/Managers/GameManager.cs
View file @
5c8e1c1c
...
...
@@ -36,6 +36,24 @@ public class GameManager : SingletonBehaviour<GameManager>
Debug
.
Log
(
"Stage Clear!"
);
}
public
IEnumerator
GameOver
()
{
Debug
.
Log
(
"Game Over!"
);
StopAllCoroutines
();
yield
return
new
WaitForSeconds
(
1
);
foreach
(
GameObject
child
in
MapManager
.
inst
.
players
)
Destroy
(
child
);
Destroy
(
MapManager
.
inst
.
currentMap
.
gameObject
);
}
public
void
StageRestart
()
{
Debug
.
Log
(
"Game Restart!"
);
GameOver
();
MapManager
.
inst
.
LoadMap
(
MapManager
.
inst
.
stage
[
0
]);
}
void
Awake
()
{
//Reset clear index to -1.
...
...
Assets/Scripts/Managers/MapManager.cs
View file @
5c8e1c1c
...
...
@@ -9,6 +9,7 @@ public class MapManager : SingletonBehaviour<MapManager>
public
bool
isMapEditingOn
;
public
NavMeshSurface
surface
;
public
Map
currentMap
;
public
Map
emptyMap
;
[
Header
(
"Instances"
)]
public
Floor
floor
;
public
NormalWall
normalWall
;
...
...
@@ -31,7 +32,7 @@ public class MapManager : SingletonBehaviour<MapManager>
public
void
LoadMap
(
TextAsset
_newMap
)
{
var
loadedMapData
=
JsonConvert
.
DeserializeObject
<
MapEditor
.
MapSaveData
>(
_newMap
.
ToString
());
currentMap
=
Instantiate
(
current
Map
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
);
currentMap
=
Instantiate
(
empty
Map
,
new
Vector3
(
0
,
0
,
0
),
Quaternion
.
identity
);
currentMap
.
InitiateMap
();
currentMap
.
maxMapSize
=
(
int
)
loadedMapData
.
objects
[
0
].
xPos
;
int
casesIndex
=
0
;
...
...
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