Commit 79a11cd9 authored by 18손재민's avatar 18손재민

이제 게임 시작시 카메라가 보는 중심은 정확히 맵의 중앙이 됨

parent f59ef243
fileFormatVersion: 2
guid: 47baf9abe59c90a4d914127b0527c24f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -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: 1431075334}
renderTexture: {fileID: 693028346}
extraRenderTexture: {fileID: 1361509628}
--- !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 &1431075334
--- !u!84 &1361509628
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
......
......@@ -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;
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment