- 最后登录
- 2019-12-2
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 34660
![Rank: 7](static/image/common//star_level3.gif) ![Rank: 7](static/image/common//star_level2.gif) ![Rank: 7](static/image/common//star_level1.gif)
- 纳金币
- 38268
- 精华
- 111
|
- using UnityEngine;
-
- using System.Collections;
-
- public class LookAtCamera : MonoBehaviour
-
- {
-
- public Camera cameraToLookAt;
- //unity3d教程:www.unitymanual.com
- void Update()
-
- {
-
- Vector3 v = cameraToLookAt.transform.position - transform.position;
-
- v.x = v.z = 0.0f;
-
- transform.LookAt(cameraToLookAt.transform.position - v);
-
- }
-
- }
-
-
-
复制代码 * 版权声明:转载时请以超链接形式标明文章原始出处和作者信息
* 本文来自:Unity3D 教程手册
* 本文链接:http://www.unitymanual.com/6628.html
|
|