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
daf752cb
Commit
daf752cb
authored
May 05, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
거짓탄 바닥 복사 구현
parent
892932a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
Mirror.cs
Assets/Scripts/Interactors/Mirror.cs
+17
-3
No files found.
Assets/Scripts/Interactors/Mirror.cs
View file @
daf752cb
...
...
@@ -36,7 +36,7 @@ public class Mirror : MonoBehaviour, IBulletInteractor, IBreakable
if
(
bullet
is
FakeBullet
)
{
// Make reflected objects
CopyObjects
(
null
);
CopyObjects
(
PlayerController
.
inst
.
currentPlayer
);
}
else
if
(
bullet
is
TruthBullet
)
{
...
...
@@ -90,12 +90,24 @@ public class Mirror : MonoBehaviour, IBulletInteractor, IBreakable
foreach
(
var
floor
in
MapManager
.
inst
.
currentMap
.
floorGrid
)
{
if
((
dir
?
floor
.
Key
.
y
:
floor
.
Key
.
x
)
==
i
)
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
floor
.
Value
.
mapPos
,
true
)))
/*copy floor*/
;
{
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
floor
.
Value
.
mapPos
,
true
)))
{
// copy floor
int
nextx
=
dir
?
floor
.
Key
.
x
:
2
*
ldPos
.
x
-
floor
.
Key
.
x
;
int
nexty
=
dir
?
2
*
ldPos
.
y
-
floor
.
Key
.
y
:
floor
.
Key
.
y
;
MapManager
.
inst
.
currentMap
.
CreateFloor
(
nextx
,
nexty
);
}
}
}
foreach
(
var
obj
in
MapManager
.
inst
.
currentMap
.
objectGrid
)
{
if
((
dir
?
obj
.
Key
.
y
:
obj
.
Key
.
x
)
==
i
)
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
obj
.
Value
.
GetPos
(),
true
)))
/*copy object*/
;
{
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
obj
.
Value
.
GetPos
(),
true
)))
{
/*copy object*/
}
}
}
foreach
(
var
wall
in
MapManager
.
inst
.
currentMap
.
wallGrid
)
{
...
...
@@ -103,6 +115,7 @@ public class Mirror : MonoBehaviour, IBulletInteractor, IBreakable
{
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
wall
.
Value
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wall
.
Value
.
rdPos
,
true
));
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
/*copy wall*/
SubtractRay
(
parRay
,
pair
);
}
}
...
...
@@ -112,6 +125,7 @@ public class Mirror : MonoBehaviour, IBulletInteractor, IBreakable
{
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
mirr
.
Value
.
ldPos
,
true
),
PointToParRay
(
stPos
,
mirr
.
Value
.
rdPos
,
true
));
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
/*copy mirror*/
SubtractRay
(
parRay
,
pair
);
}
}
...
...
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