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
759643e8
Commit
759643e8
authored
Jun 05, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
마네킹 및 터렛 제외한 모든 승리조건 넣음
parent
88e50fd3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
45 additions
and
17 deletions
+45
-17
Player3Test.prefab
Assets/Player3Test.prefab
+1
-1
Briefcase.cs
Assets/Scripts/Interactors/Briefcase.cs
+6
-0
ClearCondition.cs
Assets/Scripts/Map/ClearCondition.cs
+0
-1
Map.cs
Assets/Scripts/Map/Map.cs
+2
-0
MapManager.cs
Assets/Scripts/MapManager.cs
+1
-1
Player.cs
Assets/Scripts/Player.cs
+4
-9
PlayerController.cs
Assets/Scripts/PlayerController.cs
+31
-5
No files found.
Assets/Player3Test.prefab
View file @
759643e8
...
...
@@ -381,7 +381,7 @@ MonoBehaviour:
clearConditions
:
-
type
:
0
count
:
0
goal
:
4
goal
:
3
-
type
:
3
count
:
0
goal
:
3
...
...
Assets/Scripts/Interactors/Briefcase.cs
View file @
759643e8
...
...
@@ -31,9 +31,15 @@ public class Briefcase : MonoBehaviour, IObject, IPlayerInteractor
if
(
Position
==
position
)
{
if
(
GameManager
.
aCase
>=
0
)
{
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aCase
].
count
++;
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aCase
].
IsDone
();
}
if
(
GameManager
.
nCase
>=
0
)
{
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nCase
].
count
++;
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nCase
].
IsDone
();
}
Destroy
(
gameObject
);
}
}
...
...
Assets/Scripts/Map/ClearCondition.cs
View file @
759643e8
...
...
@@ -34,7 +34,6 @@ public class ClearCondition
{
if
(!
isDone
)
{
count
++;
if
(
goal
<=
count
)
{
GameManager
.
inst
.
clearCounter
--;
...
...
Assets/Scripts/Map/Map.cs
View file @
759643e8
...
...
@@ -60,6 +60,8 @@ public class Map : MonoBehaviour
floorGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
floor
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
floors
.
transform
).
GetComponent
<
Floor
>());
floorGrid
[
pos
].
mapPos
=
pos
;
floorGrid
[
pos
].
isPassed
=
false
;
if
(
GameManager
.
aFloor
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aFloor
].
goal
++;
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
}
else
...
...
Assets/Scripts/MapManager.cs
View file @
759643e8
...
...
@@ -29,7 +29,7 @@ public class MapManager : SingletonBehaviour<MapManager>
surface
.
BuildNavMesh
();
GameManager
.
inst
.
SetClearIndex
(
currentMap
);
for
(
int
i
=
0
;
i
<
currentMap
.
startFloors
.
Count
;
i
++)
PlayerController
.
inst
.
CreatePlayer
(
currentMap
.
startFloors
[
i
]
.
transform
.
position
);
PlayerController
.
inst
.
CreatePlayer
(
currentMap
.
startFloors
[
i
]);
}
public
IEnumerator
Rebaker
()
{
...
...
Assets/Scripts/Player.cs
View file @
759643e8
...
...
@@ -15,6 +15,8 @@ public class Player : MonoBehaviour
public
GameObject
shootingArm
;
Animator
anim
;
public
Floor
currentFloor
;
/// <summary>
/// Set this player as the current player.
/// </summary>
...
...
@@ -68,15 +70,8 @@ public class Player : MonoBehaviour
while
(
Mathf
.
Abs
(
transform
.
position
.
x
-
destination
.
x
)
>
0.01f
||
Mathf
.
Abs
(
transform
.
position
.
z
-
destination
.
z
)
>
0.01f
)
yield
return
null
;
transform
.
position
=
new
Vector3
(
destination
.
x
,
transform
.
position
.
y
,
destination
.
z
);
Floor
currentFloor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
new
Vector2Int
((
int
)
destination
.
x
,
(
int
)
destination
.
z
));
if
(!
currentFloor
.
isPassed
)
{
currentFloor
.
isPassed
=
true
;
if
(
GameManager
.
aFloor
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aFloor
].
IsDone
();
if
(
GameManager
.
nFloor
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nFloor
].
IsDone
();
}
currentFloor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
new
Vector2Int
((
int
)
destination
.
x
,
(
int
)
destination
.
z
));
PlayerController
.
inst
.
CheckCurrentFloors
();
anim
.
SetBool
(
"isWalking"
,
false
);
PlayerController
.
inst
.
isPlayerMoving
=
false
;
}
...
...
Assets/Scripts/PlayerController.cs
View file @
759643e8
...
...
@@ -27,14 +27,40 @@ public class PlayerController : SingletonBehaviour<PlayerController>
public
event
Action
<
Vector2Int
>
OnPlayerMove
;
public
void
CreatePlayer
(
Vector3
playerPos
)
public
void
CreatePlayer
(
Floor
floor
)
{
MapManager
.
inst
.
players
.
Add
(
Instantiate
(
MapManager
.
inst
.
player
,
playerPos
+
new
Vector3
(
0
,
0.1f
,
0
),
Quaternion
.
identity
));
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nPlayer
].
count
=
MapManager
.
inst
.
players
.
Count
-
1
;
Debug
.
Log
(
MapManager
.
inst
.
players
.
Count
-
1
);
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nPlayer
].
IsDone
();
GameObject
player
=
Instantiate
(
MapManager
.
inst
.
player
,
floor
.
transform
.
position
+
new
Vector3
(
0
,
0.1f
,
0
),
Quaternion
.
identity
);
player
.
GetComponent
<
Player
>().
currentFloor
=
floor
;
MapManager
.
inst
.
players
.
Add
(
player
);
if
(
GameManager
.
nPlayer
>=
0
)
{
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nPlayer
].
count
=
MapManager
.
inst
.
players
.
Count
;
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nPlayer
].
IsDone
();
}
CheckCurrentFloors
();
}
public
void
CheckCurrentFloors
()
{
int
goalFloorCount
=
0
;
foreach
(
GameObject
child
in
MapManager
.
inst
.
players
)
{
Debug
.
Log
(
"df"
);
if
(
child
.
GetComponent
<
Player
>().
currentFloor
.
isGoalFloor
)
goalFloorCount
++;
Debug
.
Log
(
goalFloorCount
);
}
if
(
GameManager
.
aFloor
>=
0
)
{
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aFloor
].
count
=
goalFloorCount
;
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aFloor
].
IsDone
();
}
if
(
GameManager
.
nFloor
>=
0
)
{
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nFloor
].
count
=
goalFloorCount
;
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nFloor
].
IsDone
();
}
}
//For test
public
string
GetCurrentBullet
()
...
...
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