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
a60d01e7
Commit
a60d01e7
authored
Aug 08, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
거울 로직 변경 및 거울로 사라지면 파괴로 카운트 안하게 만듬
parent
aed576ba
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
140 additions
and
197 deletions
+140
-197
Pair.cs
Assets/Scripts/Generals/Pair.cs
+5
-2
Map.cs
Assets/Scripts/Map/Map.cs
+9
-6
Mirror.cs
Assets/Scripts/Map/Mirror.cs
+126
-189
No files found.
Assets/Scripts/Generals/Pair.cs
View file @
a60d01e7
...
...
@@ -11,11 +11,14 @@ public class Pair
{
this
.
l
=
_l
;
this
.
r
=
_r
;
if
(
_l
>
_r
)
Swap
();
}
public
Pair
Swap
()
public
void
Swap
()
{
return
new
Pair
(
r
,
l
);
float
temp
=
l
;
l
=
r
;
r
=
temp
;
}
public
Pair
ApplyMargin
(
float
margin
)
...
...
Assets/Scripts/Map/Map.cs
View file @
a60d01e7
...
...
@@ -126,7 +126,7 @@ public class Map : MonoBehaviour
/// </summary>
/// <param name="pos">Position of wall.</param>
/// <param name="wallType">Type of wall.</param>
public
void
CreateWall
(
Vector2
pos
,
WallType
wallType
)
public
void
CreateWall
(
Vector2
pos
,
WallType
wallType
,
bool
isBreak
=
true
)
{
if
(((
int
)
pos
.
x
>=
0
?
((
int
)
pos
.
x
>
maxMapSize
/
2
)
:
((
int
)
pos
.
x
<
-
maxMapSize
/
2
))
||
((
int
)
pos
.
y
>=
0
?
((
int
)
pos
.
y
>
maxMapSize
/
2
)
:
((
int
)
pos
.
y
<
-
maxMapSize
/
2
)))
{
...
...
@@ -157,7 +157,12 @@ public class Map : MonoBehaviour
Debug
.
Log
(
"Wall already exists at : "
+
pos
);
if
(
wallGrid
[
pos
].
type
==
WallType
.
Normal
&&
wallType
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
pos
);
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
pos
,
isBreak
);
}
else
if
(
wallGrid
[
pos
].
type
==
WallType
.
Mirror
&&
wallType
==
WallType
.
Normal
)
{
RemoveWall
(
pos
);
CreateWall
(
pos
,
WallType
.
Normal
);
}
}
}
...
...
@@ -181,7 +186,7 @@ public class Map : MonoBehaviour
/// Change normal wall at position to mirror.
/// </summary>
/// <param name="pos">Position of wall.</param>
public
void
ChangeToMirror
(
Vector2
pos
)
public
void
ChangeToMirror
(
Vector2
pos
,
bool
isBreak
=
true
)
{
if
(((
int
)
pos
.
x
>=
0
?
((
int
)
pos
.
x
>
maxMapSize
/
2
)
:
((
int
)
pos
.
x
<
-
maxMapSize
/
2
))
||
((
int
)
pos
.
y
>=
0
?
((
int
)
pos
.
y
>
maxMapSize
/
2
)
:
((
int
)
pos
.
y
<
-
maxMapSize
/
2
)))
{
...
...
@@ -195,7 +200,7 @@ public class Map : MonoBehaviour
}
if
(
wallGrid
.
ContainsKey
(
pos
))
{
(
wallGrid
[
pos
]
as
NormalWall
).
Break
();
if
(
isBreak
)
(
wallGrid
[
pos
]
as
NormalWall
).
Break
();
RemoveWall
(
pos
);
wallGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
mirror
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
walls
.
transform
).
GetComponent
<
Wall
>());
wallGrid
[
pos
].
mapPos
=
pos
;
...
...
@@ -278,8 +283,6 @@ public class Map : MonoBehaviour
case
ObjType
.
Camera
:
if
(
GameManager
.
aTurret
>=
0
)
clearConditions
[
GameManager
.
aTurret
].
IsDone
(
0
,
-
1
);
if
(
GameManager
.
nTurret
>=
0
)
clearConditions
[
GameManager
.
nTurret
].
IsDone
(
1
);
PlayerController
.
inst
.
OnPlayerMove
-=
objectGrid
[
pos
].
GetObject
().
GetComponent
<
IPlayerInteractor
>().
Interact
;
break
;
case
ObjType
.
Mannequin
:
...
...
Assets/Scripts/Map/Mirror.cs
View file @
a60d01e7
This diff is collapsed.
Click to expand it.
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