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
79a11cd9
Commit
79a11cd9
authored
Aug 12, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 게임 시작시 카메라가 보는 중심은 정확히 맵의 중앙이 됨
parent
f59ef243
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
59 deletions
+70
-59
Maps.meta
Assets/Maps.meta
+8
-0
PlayStage.unity
Assets/Scenes/PlayStage.unity
+50
-50
CameraController.cs
Assets/Scripts/CameraController.cs
+9
-9
MapManager.cs
Assets/Scripts/Managers/MapManager.cs
+3
-0
No files found.
Assets/Maps.meta
0 → 100644
View file @
79a11cd9
fileFormatVersion: 2
guid: 47baf9abe59c90a4d914127b0527c24f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scenes/PlayStage.unity
View file @
79a11cd9
...
...
@@ -1048,7 +1048,7 @@ MonoBehaviour:
m_EditorClassIdentifier
:
helpUI
:
{
fileID
:
1520705829
}
dragSpeed
:
10
centerPos
:
{
x
:
0
,
y
:
0
,
z
:
0
}
centerPos
:
{
x
:
-0.5
,
y
:
0
,
z
:
-0.5
}
---
!u!114
&534669907
MonoBehaviour
:
m_ObjectHideFlags
:
0
...
...
@@ -1137,8 +1137,8 @@ MonoBehaviour:
sourceCamera
:
{
fileID
:
534669904
}
outlineCamera
:
{
fileID
:
1548020010
}
outlineShaderMaterial
:
{
fileID
:
0
}
renderTexture
:
{
fileID
:
802954674
}
extraRenderTexture
:
{
fileID
:
1
431075334
}
renderTexture
:
{
fileID
:
693028346
}
extraRenderTexture
:
{
fileID
:
1
361509628
}
---
!u!1
&617748942
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -1365,6 +1365,41 @@ CanvasRenderer:
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
666076611
}
m_CullTransparentMesh
:
0
---
!u!84
&693028346
RenderTexture
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_ImageContentsHash
:
serializedVersion
:
2
Hash
:
00000000000000000000000000000000
m_ForcedFallbackFormat
:
4
m_DownscaleFallback
:
0
serializedVersion
:
3
m_Width
:
1920
m_Height
:
1080
m_AntiAliasing
:
1
m_MipCount
:
-1
m_DepthFormat
:
1
m_ColorFormat
:
4
m_MipMap
:
0
m_GenerateMips
:
1
m_SRGB
:
1
m_UseDynamicScale
:
0
m_BindMS
:
0
m_EnableCompatibleFormat
:
1
m_TextureSettings
:
serializedVersion
:
2
m_FilterMode
:
1
m_Aniso
:
1
m_MipBias
:
0
m_WrapU
:
1
m_WrapV
:
1
m_WrapW
:
1
m_Dimension
:
2
m_VolumeDepth
:
1
---
!u!1
&770981479
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -1570,41 +1605,6 @@ RectTransform:
m_AnchoredPosition
:
{
x
:
895
,
y
:
-490
}
m_SizeDelta
:
{
x
:
100
,
y
:
60
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!84
&802954674
RenderTexture
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_Name
:
m_ImageContentsHash
:
serializedVersion
:
2
Hash
:
00000000000000000000000000000000
m_ForcedFallbackFormat
:
4
m_DownscaleFallback
:
0
serializedVersion
:
3
m_Width
:
1920
m_Height
:
1080
m_AntiAliasing
:
1
m_MipCount
:
-1
m_DepthFormat
:
1
m_ColorFormat
:
4
m_MipMap
:
0
m_GenerateMips
:
1
m_SRGB
:
1
m_UseDynamicScale
:
0
m_BindMS
:
0
m_EnableCompatibleFormat
:
1
m_TextureSettings
:
serializedVersion
:
2
m_FilterMode
:
1
m_Aniso
:
1
m_MipBias
:
0
m_WrapU
:
1
m_WrapV
:
1
m_WrapW
:
1
m_Dimension
:
2
m_VolumeDepth
:
1
---
!u!1
&1015578410
GameObject
:
m_ObjectHideFlags
:
0
...
...
@@ -1817,7 +1817,7 @@ CanvasRenderer:
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1205101239
}
m_CullTransparentMesh
:
0
---
!u!84
&1
431075334
---
!u!84
&1
361509628
RenderTexture
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
...
...
@@ -2254,7 +2254,7 @@ Camera:
serializedVersion
:
2
m_Bits
:
0
m_RenderingPath
:
1
m_TargetTexture
:
{
fileID
:
802954674
}
m_TargetTexture
:
{
fileID
:
693028346
}
m_TargetDisplay
:
0
m_TargetEye
:
3
m_HDR
:
0
...
...
@@ -3142,16 +3142,6 @@ PrefabInstance:
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
52444459818764334
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_Name
value
:
GameManager
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764334
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_IsActive
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
2122327709
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
uiGenerator
value
:
...
...
@@ -3196,6 +3186,16 @@ PrefabInstance:
propertyPath
:
menuUIController
value
:
objectReference
:
{
fileID
:
158856775
}
-
target
:
{
fileID
:
52444459818764334
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_Name
value
:
GameManager
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764334
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_IsActive
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalPosition.x
...
...
Assets/Scripts/CameraController.cs
View file @
79a11cd9
...
...
@@ -19,7 +19,7 @@ public class CameraController : MonoBehaviour
float
sensitivity
=
1
;
[
SerializeField
]
Vector3
centerPos
=
new
Vector3
(
0
,
0
,
0
);
public
Vector3
centerPos
=
new
Vector3
(-
0.5f
,
0
,
-
0.5f
);
Vector3
distance
=
new
Vector3
(
0
,
0
,
0
);
/// <summary>
/// Move camera.
...
...
@@ -91,14 +91,14 @@ public class CameraController : MonoBehaviour
for
(
i
=
0
;
i
<
cameraMoveDuration
;
i
+=
1
)
{
yield
return
new
WaitForSeconds
(
0.01f
);
if
(
Input
.
GetMouseButtonDown
(
0
))
break
;
/*
if (Input.GetMouseButtonDown(0))
break;
*/
transform
.
position
+=
posDiff
;
transform
.
eulerAngles
+=
new
Vector3
(
angleDiff
,
0
,
0
);
Camera
.
main
.
fieldOfView
=
Mathf
.
Lerp
(
mapFov
,
shootingFov
,
i
/
cameraMoveDuration
);
}
transform
.
position
+=
posDiff
*
(
cameraMoveDuration
-
i
);
transform
.
eulerAngles
+=
new
Vector3
(
angleDiff
*
(
cameraMoveDuration
-
i
),
0
,
0
);
/*
transform.position += posDiff * (cameraMoveDuration - i);
transform.eulerAngles += new Vector3(angleDiff * (cameraMoveDuration - i), 0, 0);
*/
Camera
.
main
.
fieldOfView
=
shootingFov
;
player
.
transform
.
eulerAngles
=
new
Vector3
(
player
.
transform
.
eulerAngles
.
x
,
transform
.
eulerAngles
.
y
,
player
.
transform
.
eulerAngles
.
z
);
...
...
@@ -140,14 +140,14 @@ public class CameraController : MonoBehaviour
for
(
i
=
0
;
i
<
cameraMoveDuration
;
i
+=
1
)
{
yield
return
new
WaitForSeconds
(
0.01f
);
if
(
Input
.
GetMouseButtonDown
(
0
))
break
;
/*
if (Input.GetMouseButtonDown(0))
break;
*/
transform
.
position
+=
posDiff
;
transform
.
eulerAngles
+=
angleDiff
;
Camera
.
main
.
fieldOfView
=
Mathf
.
Lerp
(
shootingFov
,
mapFov
,
i
/
cameraMoveDuration
);
}
transform
.
position
+=
posDiff
*
(
cameraMoveDuration
-
i
);
transform
.
eulerAngles
+=
angleDiff
*
(
cameraMoveDuration
-
i
);
/*
transform.position += posDiff * (cameraMoveDuration - i);
transform.eulerAngles += angleDiff * (cameraMoveDuration - i);
*/
Camera
.
main
.
fieldOfView
=
mapFov
;
transform
.
position
=
previousPos
;
...
...
Assets/Scripts/Managers/MapManager.cs
View file @
79a11cd9
...
...
@@ -91,6 +91,9 @@ public class MapManager : SingletonBehaviour<MapManager>
currentMap
.
comments
=
loadedMapData
.
comments
;
GameManager
.
inst
.
commentUIGenerator
.
SetComment
(
currentMap
.
comments
);
}
Camera
.
main
.
GetComponent
<
CameraController
>().
centerPos
=
new
Vector3
((
float
)(
currentMap
.
maxBorder
.
x
+
currentMap
.
minBorder
.
x
)
/
2
,
0
,
(
float
)(
currentMap
.
maxBorder
.
y
+
currentMap
.
minBorder
.
y
)
/
2
);
Debug
.
Log
(
new
Vector3
((
float
)(
currentMap
.
maxBorder
.
x
+
currentMap
.
minBorder
.
x
)
/
2
,
0
,
(
float
)(
currentMap
.
maxBorder
.
y
+
currentMap
.
minBorder
.
y
)
/
2
));
}
public
IEnumerator
Rebaker
()
...
...
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