【发布时间】:2016-07-27 13:53:57
【问题描述】:
我目前正在尝试创建一个统一的相机控件(跟随预制件并能够缩放等等......
我是 C# 新手
我在使用这个脚本时遇到的一个问题是
- 相机缩放到 0,0,0。 (当我需要它保持在当前 Y 轴时,我尝试更改 void "Move()" 但向量需要 3 m_....
我还需要编写一段代码,让玩家可以使用 滚轮...(在“公共无效更新()”中...
我一直在浏览指南和视频,但找不到任何可以帮助我解决此问题的内容..
这是我需要帮助的代码部分:
private void FixedUpdate()
{
Move();
}
private void Move()
{
m_DesiredPosition = m_target.position;
transform.position = Vector3.SmoothDamp(transform.position,
m_DesiredPosition, ref m_MoveVelocity, m_DampTime);
}
public void Update()
{
// Get the scroll value of the mouse scroll wheel
// float scroll = Input.GetAxis("Mouse ScrollWheel");
// Is the scroll value not 0?
// Modify the orthographic size by the scroll value
Camera.main.orthographicSize = 4.8f;
}
【问题讨论】:
标签: c# unity3d unityscript