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
892932a1
Commit
892932a1
authored
5 years ago
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
거울에 반사 이후에 대한거 다 만듬
parent
cea5f4a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
Mirror.cs
Assets/Scripts/Interactors/Mirror.cs
+43
-1
No files found.
Assets/Scripts/Interactors/Mirror.cs
View file @
892932a1
...
...
@@ -73,7 +73,49 @@ public class Mirror : MonoBehaviour, IBulletInteractor, IBreakable
}
}
// TODO: pos부터 맵의 끝까지 검사해 맵의 각 요소가 IfInRay면 거울 반대편에 복사, 벽이나 거울이면 SubtractRay
// check after reflect, if obj or floor, copy else if wall or mirror, Subtract
int
side
,
i
;
if
(
dir
)
// horizontal, parallel with x
{
side
=
(
ldPos
.
y
-
stPos
.
y
>
0
)
?
-
1
:
1
;
i
=
ldPos
.
y
;
}
else
// vertical, parallel with y
{
side
=
(
ldPos
.
x
-
stPos
.
x
>
0
)
?
-
1
:
1
;
i
=
ldPos
.
x
;
}
for
(;
i
<
MapManager
.
inst
.
currentMap
.
maxMapSize
;
i
+=
side
)
{
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*/
;
}
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*/
;
}
foreach
(
var
wall
in
MapManager
.
inst
.
currentMap
.
wallGrid
)
{
if
((
dir
?
wall
.
Key
.
y
:
wall
.
Key
.
x
)
==
i
)
{
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
();
SubtractRay
(
parRay
,
pair
);
}
}
foreach
(
var
mirr
in
MapManager
.
inst
.
currentMap
.
mirrorGrid
)
{
if
(
mirr
.
Value
!=
this
&&
(
dir
?
mirr
.
Key
.
y
:
mirr
.
Key
.
x
)
==
i
)
{
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
();
SubtractRay
(
parRay
,
pair
);
}
}
}
}
/// <summary>
...
...
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