Commit 6424eb56 authored by 16이진형's avatar 16이진형

카메라 줌인아웃 기능

parent 00600790
...@@ -660,6 +660,8 @@ MonoBehaviour: ...@@ -660,6 +660,8 @@ MonoBehaviour:
levelManager: {fileID: 279236944} levelManager: {fileID: 279236944}
player: {fileID: 739347346} player: {fileID: 739347346}
pathRenderer: {fileID: 948598108} pathRenderer: {fileID: 948598108}
cameraMovement: {fileID: 1661408491}
scrollSpeed: 5
--- !u!4 &394305456 --- !u!4 &394305456
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
...@@ -3562,6 +3564,9 @@ MonoBehaviour: ...@@ -3562,6 +3564,9 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
Levelmanager: {fileID: 279236944} Levelmanager: {fileID: 279236944}
minSize: 5
defaultSize: 10
maxSize: 50
--- !u!114 &1661408492 --- !u!114 &1661408492
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
......
...@@ -7,6 +7,10 @@ public class CameraMovement : MonoBehaviour ...@@ -7,6 +7,10 @@ public class CameraMovement : MonoBehaviour
public LevelManager Levelmanager; public LevelManager Levelmanager;
public double minSize = 5.0;
public double defaultSize = 10.0;
public double maxSize = 50.0;
Camera thecamera; Camera thecamera;
double aspect; double aspect;
double size; double size;
...@@ -16,8 +20,8 @@ public class CameraMovement : MonoBehaviour ...@@ -16,8 +20,8 @@ public class CameraMovement : MonoBehaviour
{ {
//playergamma = 1.0f; //playergamma = 1.0f;
thecamera = GetComponent<Camera>(); thecamera = GetComponent<Camera>();
aspect = 16.0f / 9.0f; aspect = 16.0 / 9.0;
size = 10.0f; size = defaultSize;
} }
// Update is called once per frame // Update is called once per frame
...@@ -48,4 +52,27 @@ public class CameraMovement : MonoBehaviour ...@@ -48,4 +52,27 @@ public class CameraMovement : MonoBehaviour
transform.Translate(-Vector3.forward * 50); // number is distance of camera from player transform.Translate(-Vector3.forward * 50); // number is distance of camera from player
} }
public double Size
{
get
{
return size;
}
set
{
if(value < minSize)
{
size = minSize;
}
else if (value > maxSize)
{
size = maxSize;
}
else
{
size = value;
}
}
}
} }
\ No newline at end of file
...@@ -31,6 +31,10 @@ public class UIManager : MonoBehaviour ...@@ -31,6 +31,10 @@ public class UIManager : MonoBehaviour
public PlayerMovement player; public PlayerMovement player;
public PathRenderer pathRenderer; public PathRenderer pathRenderer;
public CameraMovement cameraMovement;
public float scrollSpeed = 1.0f;
private int prevSelectPathNum = -1; private int prevSelectPathNum = -1;
private Text pathName; private Text pathName;
private Text pathVelocity; private Text pathVelocity;
...@@ -64,6 +68,9 @@ public class UIManager : MonoBehaviour ...@@ -64,6 +68,9 @@ public class UIManager : MonoBehaviour
{ {
wintext.gameObject.SetActive(true); wintext.gameObject.SetActive(true);
} }
//마우스 클릭시
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0))
{ {
ped.position = Input.mousePosition; ped.position = Input.mousePosition;
...@@ -110,6 +117,12 @@ public class UIManager : MonoBehaviour ...@@ -110,6 +117,12 @@ public class UIManager : MonoBehaviour
sliderflag = 0; sliderflag = 0;
} }
//마우스 휠
float scroll = Input.GetAxis("Mouse ScrollWheel") * scrollSpeed;
cameraMovement.Size += scroll;
//player movement //player movement
if (pathRenderer.pathcreatable) if (pathRenderer.pathcreatable)
......
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