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
8716777e
Commit
8716777e
authored
Aug 08, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
거울에 보이는 회전각도로 생성되게 만듬, 플레이어 콜라이더 더 조정,
parent
1fe64d95
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
21 deletions
+46
-21
jackson.prefab
Assets/Prefabs/MapObjects/jackson.prefab
+4
-4
camera.prefab
Assets/Prefabs/Objects/camera.prefab
+4
-4
FakeBullet.cs
Assets/Scripts/Bullets/FakeBullet.cs
+1
-1
MirrorBullet.cs
Assets/Scripts/Bullets/MirrorBullet.cs
+1
-1
TruthBullet.cs
Assets/Scripts/Bullets/TruthBullet.cs
+1
-1
Mirror.cs
Assets/Scripts/Map/Mirror.cs
+10
-5
Player.cs
Assets/Scripts/Player.cs
+1
-1
PlayerController.cs
Assets/Scripts/PlayerController.cs
+23
-4
BulletUIGenerator.cs
Assets/Scripts/UIs/BulletUIGenerator.cs
+1
-0
No files found.
Assets/Prefabs/MapObjects/jackson.prefab
View file @
8716777e
...
...
@@ -1417,10 +1417,10 @@ CapsuleCollider:
m_Material
:
{
fileID
:
0
}
m_IsTrigger
:
1
m_Enabled
:
1
m_Radius
:
0.
11
m_Height
:
1.6
m_Radius
:
0.
2
m_Height
:
2
m_Direction
:
1
m_Center
:
{
x
:
0
,
y
:
1
,
z
:
0
}
m_Center
:
{
x
:
0
,
y
:
1
.1
,
z
:
0
}
---
!u!114
&6489731509539496108
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
@@ -2537,7 +2537,7 @@ GameObject:
-
component
:
{
fileID
:
3848187736642518088
}
-
component
:
{
fileID
:
886384046876709786
}
-
component
:
{
fileID
:
2401818891807728848
}
m_Layer
:
8
m_Layer
:
11
m_Name
:
V-Light Spot
0
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
...
...
Assets/Prefabs/Objects/camera.prefab
View file @
8716777e
...
...
@@ -311,7 +311,7 @@ Light:
m_Cookie
:
{
fileID
:
0
}
m_DrawHalo
:
0
m_Flare
:
{
fileID
:
0
}
m_RenderMode
:
0
m_RenderMode
:
1
m_CullingMask
:
serializedVersion
:
2
m_Bits
:
7991
...
...
@@ -402,7 +402,7 @@ Light:
m_Cookie
:
{
fileID
:
0
}
m_DrawHalo
:
0
m_Flare
:
{
fileID
:
0
}
m_RenderMode
:
0
m_RenderMode
:
1
m_CullingMask
:
serializedVersion
:
2
m_Bits
:
7991
...
...
@@ -994,7 +994,7 @@ Light:
m_Cookie
:
{
fileID
:
0
}
m_DrawHalo
:
0
m_Flare
:
{
fileID
:
0
}
m_RenderMode
:
0
m_RenderMode
:
1
m_CullingMask
:
serializedVersion
:
2
m_Bits
:
7991
...
...
@@ -1646,7 +1646,7 @@ Light:
m_Cookie
:
{
fileID
:
0
}
m_DrawHalo
:
0
m_Flare
:
{
fileID
:
0
}
m_RenderMode
:
0
m_RenderMode
:
1
m_CullingMask
:
serializedVersion
:
2
m_Bits
:
7991
...
...
Assets/Scripts/Bullets/FakeBullet.cs
View file @
8716777e
...
...
@@ -6,7 +6,7 @@ public class FakeBullet : Bullet
{
protected
override
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
))
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
)
&&
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Player"
)
)
{
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
...
...
Assets/Scripts/Bullets/MirrorBullet.cs
View file @
8716777e
...
...
@@ -6,7 +6,7 @@ public class MirrorBullet : Bullet
{
protected
override
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
))
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
)
&&
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Player"
)
)
{
if
(
other
.
GetComponent
<
IBulletInteractor
>()
!=
null
)
{
...
...
Assets/Scripts/Bullets/TruthBullet.cs
View file @
8716777e
...
...
@@ -6,7 +6,7 @@ public class TruthBullet : Bullet
{
protected
override
void
OnTriggerEnter
(
Collider
other
)
{
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
))
if
(
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Scattered"
)
&&
other
.
gameObject
.
layer
!=
LayerMask
.
NameToLayer
(
"Player"
)
)
{
if
(
other
.
GetComponent
<
IBreakable
>()
!=
null
)
{
...
...
Assets/Scripts/Map/Mirror.cs
View file @
8716777e
...
...
@@ -186,11 +186,7 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
if
(
oppoFloor
.
isPlayerOn
)
PlayerController
.
inst
.
RemovePlayer
(
oppoFloor
);
if
(
oppoFloor
.
objOnFloor
!=
null
)
MapManager
.
inst
.
currentMap
.
RemoveObject
(
oppoPos
);
}
else
{
oppoFloor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
oppoPos
);
}
if
(
originFloor
.
isPlayerOn
&&
oppoFloor
!=
null
)
PlayerController
.
inst
.
CreatePlayer
(
oppoFloor
);
if
(
originFloor
.
isPlayerOn
)
PlayerController
.
inst
.
CreatePlayer
(
oppoPos
,
floorCount
.
Key
,
dir
);
else
if
(
originFloor
.
objOnFloor
!=
null
)
{
IObject
obj
=
originFloor
.
objOnFloor
;
...
...
@@ -198,6 +194,15 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
{
case
ObjType
.
Mannequin
:
MapManager
.
inst
.
currentMap
.
CreateObject
(
oppoPos
,
ObjType
.
Mannequin
,
(
obj
as
Mannequin
).
isWhite
);
GameObject
tempMann
=
MapManager
.
inst
.
currentMap
.
GetObjectAtPos
(
floorCount
.
Key
).
GetObject
();
GameObject
oppoMann
=
MapManager
.
inst
.
currentMap
.
GetObjectAtPos
(
oppoPos
).
GetObject
();
Quaternion
mirroredRotation
=
tempMann
.
transform
.
rotation
;
Vector3
mirroredScale
=
tempMann
.
transform
.
localScale
;
mirroredRotation
.
w
*=
-
1
;
if
(
dir
)
{
mirroredRotation
.
z
*=
-
1
;
mirroredScale
.
z
*=
-
1
;
}
else
{
mirroredRotation
.
x
*=
-
1
;
mirroredScale
.
x
*=
-
1
;
}
oppoMann
.
transform
.
rotation
=
mirroredRotation
;
oppoMann
.
transform
.
localScale
=
mirroredScale
;
break
;
case
ObjType
.
Briefcase
:
MapManager
.
inst
.
currentMap
.
CreateObject
(
oppoPos
,
ObjType
.
Briefcase
,
(
obj
as
Briefcase
).
dropBullet
);
...
...
Assets/Scripts/Player.cs
View file @
8716777e
...
...
@@ -147,7 +147,7 @@ public class Player : MonoBehaviour
// Update is called once per frame
void
Update
()
{
if
(
GameManager
.
inst
.
isPlayerShooting
&&
!
GameManager
.
inst
.
isZooming
)
if
(
PlayerController
.
inst
.
currentPlayer
==
this
&&
GameManager
.
inst
.
isPlayerShooting
&&
!
GameManager
.
inst
.
isZooming
)
{
laser
.
transform
.
position
=
shootingFinger
.
transform
.
position
;
if
(
currentBullet
==
null
&&
lastShoot
+
1f
<
Time
.
time
)
laser
.
SetActive
(
true
);
...
...
Assets/Scripts/PlayerController.cs
View file @
8716777e
...
...
@@ -25,14 +25,14 @@ public class PlayerController : SingletonBehaviour<PlayerController>
public
event
Action
<
Vector2Int
>
OnPlayerMove
;
public
void
CreatePlayer
(
Floor
floor
)
public
GameObject
CreatePlayer
(
Floor
floor
)
{
foreach
(
var
obj
in
MapManager
.
inst
.
players
)
{
if
(
obj
.
GetComponent
<
Player
>().
currentFloor
==
floor
)
{
Debug
.
Log
(
"Player already exists on that floor."
);
return
;
return
null
;
}
}
GameObject
player
=
Instantiate
(
MapManager
.
inst
.
player
,
floor
.
transform
.
position
+
new
Vector3
(
0
,
0.1f
,
0
),
Quaternion
.
identity
);
...
...
@@ -45,11 +45,30 @@ public class PlayerController : SingletonBehaviour<PlayerController>
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
nPlayer
].
IsDone
();
}
CheckCurrentFloors
();
return
player
;
}
public
void
CreatePlayer
(
Vector2Int
floorPos
)
public
void
CreatePlayer
(
Vector2Int
floorPos
,
Vector2Int
originPos
,
bool
dir
)
{
List
<
GameObject
>
copyPlayers
=
new
List
<
GameObject
>(
MapManager
.
inst
.
players
);
Floor
originFloor
=
MapManager
.
inst
.
currentMap
.
GetFloorAtPos
(
originPos
);
Quaternion
mirroredRotation
=
Quaternion
.
identity
;
foreach
(
var
obj
in
copyPlayers
)
{
if
(
obj
.
GetComponent
<
Player
>().
currentFloor
==
originFloor
)
{
mirroredRotation
=
obj
.
transform
.
rotation
;
break
;
}
}
mirroredRotation
.
y
*=
-
1
;
if
(
dir
)
{
mirroredRotation
.
x
*=
-
1
;
mirroredRotation
=
Quaternion
.
Euler
(
mirroredRotation
.
eulerAngles
+
new
Vector3
(
0
,
180
,
0
));
}
else
mirroredRotation
.
z
*=
-
1
;
if
(
MapManager
.
inst
.
currentMap
.
floorGrid
.
TryGetValue
(
floorPos
,
out
Floor
floor
))
CreatePlayer
(
floor
);
{
GameObject
player
=
CreatePlayer
(
floor
);
player
.
transform
.
rotation
=
mirroredRotation
;
}
else
Debug
.
Log
(
"there are no floor"
);
}
...
...
Assets/Scripts/UIs/BulletUIGenerator.cs
View file @
8716777e
...
...
@@ -61,6 +61,7 @@ public class BulletUIGenerator : MonoBehaviour
if
(
uiList
.
Count
==
0
)
{
posX
-=
55
;
targetBulletUI
.
SetActive
(
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