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

카메라 줌인아웃 기능

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