1、首先打开Unity3d,点击creat,接着点击3d object下的cube,创建参考物体。
2、选中“Main camera”,并在Inspector面板点击add component,并输入脚本名字为“CameraMove”。点击new script进入下一步。
3、然后点击creat and add 创建脚本。
4、选择edit script 开始编辑脚本。
5、然后在vs中输入以下代码。
5、最后点击附加到Unity或者按下ctrl+S,回到Unity界面,就完成了。
1、首先打开Unity3d,点击creat,接着点击3d object下的cube,创建参考物体。
2、选中“Main camera”,并在Inspector面板点击add component,并输入脚本名字为“CameraMove”。点击new script进入下一步。
3、然后点击creat and add 创建脚本。
4、选择edit script 开始编辑脚本。
5、然后在vs中输入以下代码。
5、最后点击附加到Unity或者按下ctrl+S,回到Unity界面,就完成了。