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
6af24b92
Commit
6af24b92
authored
Aug 06, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
플레이어 줌인 진입시간 변경, 탄이 부숴진 조각에 반응하는 오류 해결
parent
8ba3fda8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
29 deletions
+34
-29
FakeBullet.cs
Assets/Scripts/Bullets/FakeBullet.cs
+6
-3
MirrorBullet.cs
Assets/Scripts/Bullets/MirrorBullet.cs
+8
-5
TruthBullet.cs
Assets/Scripts/Bullets/TruthBullet.cs
+10
-7
Map.cs
Assets/Scripts/Map/Map.cs
+7
-1
Mirror.cs
Assets/Scripts/Map/Mirror.cs
+1
-11
Player.cs
Assets/Scripts/Player.cs
+2
-2
No files found.
Assets/Scripts/Bullets/FakeBullet.cs
View file @
6af24b92
...
...
@@ -6,10 +6,13 @@ public class FakeBullet : Bullet
{
protected
override
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
)
)
{
other
.
GetComponent
<
IBulletInteractor
>().
Interact
(
this
);
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
other
.
GetComponent
<
IBulletInteractor
>().
Interact
(
this
);
}
Destroy
(
gameObject
);
}
Destroy
(
gameObject
);
}
}
Assets/Scripts/Bullets/MirrorBullet.cs
View file @
6af24b92
...
...
@@ -6,10 +6,13 @@ public class MirrorBullet : Bullet
{
protected
override
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
other
.
GetComponent
<
IBulletInteractor
>().
Interact
(
this
);
}
Destroy
(
gameObject
);
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
))
{
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
other
.
GetComponent
<
IBulletInteractor
>().
Interact
(
this
);
}
Destroy
(
gameObject
);
}
}
}
\ No newline at end of file
Assets/Scripts/Bullets/TruthBullet.cs
View file @
6af24b92
...
...
@@ -6,14 +6,17 @@ public class TruthBullet : Bullet
{
protected
override
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
GetComponent
<
IBreakable
>()
!=
null
)
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
)
)
{
other
.
GetComponent
<
IBreakable
>().
Break
();
if
(
other
.
GetComponent
<
IBreakable
>()
!=
null
)
{
other
.
GetComponent
<
IBreakable
>().
Break
();
}
else
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
other
.
GetComponent
<
IBulletInteractor
>().
Interact
(
this
);
}
Destroy
(
gameObject
);
}
else
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
other
.
GetComponent
<
IBulletInteractor
>().
Interact
(
this
);
}
Destroy
(
gameObject
);
}
}
Assets/Scripts/Map/Map.cs
View file @
6af24b92
...
...
@@ -140,7 +140,7 @@ public class Map : MonoBehaviour
}
if
(!
wallGrid
.
ContainsKey
(
pos
))
{
if
(
wallType
==
WallType
.
Normal
)
if
(
wallType
==
WallType
.
Normal
)
wallGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
normalWall
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
walls
.
transform
).
GetComponent
<
Wall
>());
else
if
(
wallType
==
WallType
.
Mirror
)
wallGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
mirror
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
walls
.
transform
).
GetComponent
<
Wall
>());
...
...
@@ -153,7 +153,13 @@ public class Map : MonoBehaviour
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
}
else
{
Debug
.
Log
(
"Wall already exists at : "
+
pos
);
if
(
wallGrid
[
pos
].
type
==
WallType
.
Normal
&&
wallType
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
pos
);
}
}
}
/// <summary>
/// Create walls from two floors, toward dir's direction.
...
...
Assets/Scripts/Map/Mirror.cs
View file @
6af24b92
...
...
@@ -98,16 +98,11 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
Pair
wallPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallAtPos
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wallAtPos
.
rdPos
,
true
));
if
(
wallPair
.
l
>
wallPair
.
r
)
wallPair
=
wallPair
.
Swap
();
if
(
IsInRay
(
parRay
,
wallPair
))
{
MapManager
.
inst
.
currentMap
.
CreateWall
(
oppWallPos
,
wallAtPos
.
type
);
SubtractRay
(
parRay
,
wallPair
);
if
(
wallAtPos
.
type
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
oppWallPos
);
}
}
}
else
if
(
MapManager
.
inst
.
currentMap
.
GetWallAtPos
(
oppWallPos
)
!=
null
)
// no wall at wallPos but have at opposite
...
...
@@ -135,11 +130,6 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
MapManager
.
inst
.
currentMap
.
CreateWall
(
oppWallPos
,
wallAtPos
.
type
);
SubtractRay
(
parRay
,
wallPair
);
if
(
wallAtPos
.
type
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
oppWallPos
);
}
}
}
else
if
(
MapManager
.
inst
.
currentMap
.
GetWallAtPos
(
oppWallPos
)
!=
null
)
// no wall at wallPos but have at opposite
...
...
Assets/Scripts/Player.cs
View file @
6af24b92
...
...
@@ -98,13 +98,13 @@ public class Player : MonoBehaviour
public
IEnumerator
CountPlayerClick
(
float
startTime
)
{
float
time
=
Time
.
time
;
float
endTime
=
startTime
+
2
;
float
endTime
=
startTime
+
1.5f
;
aimLight
.
gameObject
.
SetActive
(
true
);
while
(
time
<=
endTime
)
{
yield
return
null
;
aimLight
.
lightMultiplier
+=
3
*
Time
.
deltaTime
;
aimLight
.
spotAngle
-=
3
0
*
Time
.
deltaTime
;
aimLight
.
spotAngle
-=
4
0
*
Time
.
deltaTime
;
time
=
Time
.
time
;
if
(!
Input
.
GetMouseButton
(
0
))
{
...
...
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