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
b7acf6d1
Commit
b7acf6d1
authored
Jul 02, 2019
by
18신대성
Committed by
18손재민
Jul 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
거울 디버그중 WIP
parent
efa56abc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
Floor.cs
Assets/Scripts/Map/Floor.cs
+2
-0
Mirror.cs
Assets/Scripts/Map/Mirror.cs
+14
-4
No files found.
Assets/Scripts/Map/Floor.cs
View file @
b7acf6d1
...
...
@@ -11,6 +11,8 @@ public class Floor : MonoBehaviour
public
bool
isGoalFloor
=
false
;
public
IObject
objOnFloor
=
null
;
public
int
copyCounter
=
0
;
// count for mirror copy
// Start is called before the first frame update
void
Start
()
{
...
...
Assets/Scripts/Map/Mirror.cs
View file @
b7acf6d1
...
...
@@ -154,6 +154,8 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
//Debug.Log(i + "th Wall End");
}
yield
return
new
WaitForSeconds
(
3f
);
copyFloorGrid
=
new
Dictionary
<
Vector2Int
,
Floor
>(
MapManager
.
inst
.
currentMap
.
floorGrid
);
copyObjGrid
=
new
Dictionary
<
Vector2Int
,
IObject
>(
MapManager
.
inst
.
currentMap
.
objectGrid
);
copyWallGrid
=
new
Dictionary
<
Vector2
,
Wall
>(
MapManager
.
inst
.
currentMap
.
wallGrid
);
...
...
@@ -205,17 +207,20 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
}
}
}
//
Debug.Log(i + "th Wall End");
Debug
.
Log
(
i
+
"th Wall End"
);
float
range
=
i
+
0.5f
*
side
;
float
minMap
=
-
1
*
MapManager
.
inst
.
currentMap
.
maxMapSize
/
2
-
1.5f
;
float
maxMap
=
MapManager
.
inst
.
currentMap
.
maxMapSize
/
2
+
1.5f
;
for
(
float
j
=
minMap
;
Mathf
.
Abs
(
j
)
<
maxMap
;
j
++)
//Debug.Log("value: " + minMap + ", " + maxMap);
for
(
float
j
=
minMap
;
j
<
maxMap
;
j
+=
1
)
{
Vector2
point
=
dir
?
new
Vector2
(
j
,
range
)
:
new
Vector2
(
range
,
j
);
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
point
,
true
)))
{
Debug
.
Log
(
"inside "
+
point
);
// 사방의 바닥 카피, 그 위의 오브젝트도 카피
Floor
floor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
Mathf
.
FloorToInt
(
point
.
x
),
Mathf
.
FloorToInt
(
point
.
y
));
Debug
.
Log
(
floor
);
if
(
floor
!=
null
)
{
int
nextx
=
dir
?
floor
.
mapPos
.
x
:
Mathf
.
RoundToInt
(
2
*
ldPos
.
x
-
floor
.
mapPos
.
x
);
...
...
@@ -226,6 +231,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
yield
return
null
;
}
floor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
Mathf
.
FloorToInt
(
point
.
x
),
Mathf
.
CeilToInt
(
point
.
y
));
Debug
.
Log
(
floor
);
if
(
floor
!=
null
)
{
int
nextx
=
dir
?
floor
.
mapPos
.
x
:
Mathf
.
RoundToInt
(
2
*
ldPos
.
x
-
floor
.
mapPos
.
x
);
...
...
@@ -236,6 +242,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
yield
return
null
;
}
floor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
Mathf
.
CeilToInt
(
point
.
x
),
Mathf
.
FloorToInt
(
point
.
y
));
Debug
.
Log
(
floor
);
if
(
floor
!=
null
)
{
int
nextx
=
dir
?
floor
.
mapPos
.
x
:
Mathf
.
RoundToInt
(
2
*
ldPos
.
x
-
floor
.
mapPos
.
x
);
...
...
@@ -246,6 +253,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
yield
return
null
;
}
floor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
Mathf
.
CeilToInt
(
point
.
x
),
Mathf
.
CeilToInt
(
point
.
y
));
Debug
.
Log
(
floor
);
if
(
floor
!=
null
)
{
int
nextx
=
dir
?
floor
.
mapPos
.
x
:
Mathf
.
RoundToInt
(
2
*
ldPos
.
x
-
floor
.
mapPos
.
x
);
...
...
@@ -257,7 +265,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
}
}
}
//
Debug.Log(i + "th Floor End");
Debug
.
Log
(
i
+
"th Floor End"
);
foreach
(
var
ply
in
copyPlayers
)
{
Floor
plyFloor
=
ply
.
GetComponent
<
Player
>().
currentFloor
;
...
...
@@ -346,6 +354,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
bool
output
=
false
;
foreach
(
Pair
pair
in
_parRay
)
{
Debug
.
Log
(
"IsinRay ("
+
pair
.
l
+
", "
+
pair
.
r
+
") "
+
_range
.
l
+
", "
+
_range
.
r
);
if
(
pair
.
r
<=
_range
.
l
||
pair
.
l
>=
_range
.
r
)
continue
;
else
{
...
...
@@ -360,7 +369,8 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
foreach
(
Pair
pair
in
_parRay
)
{
if
(
pair
.
l
<
_obj
&&
pair
.
r
>
_obj
)
return
true
;
Debug
.
Log
(
"IsinRay ("
+
pair
.
l
+
", "
+
pair
.
r
+
") "
+
_obj
);
if
(
pair
.
l
<=
_obj
&&
pair
.
r
>=
_obj
)
return
true
;
}
return
false
;
}
...
...
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