赞
踩
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class LookAtMainCamera : MonoBehaviour {
-
- // Use this for initialization
- void Start () {
-
- }
- // Update is called once per frame
- void Update () {
-
-
- //当前对象始终面向摄像机。
- this.transform.LookAt(Camera.main.transform.position);
- this.transform.rotation = Quaternion.Slerp(this.transform.rotation, Quaternion.LookRotation(Camera.main.transform.position - this.transform.position),0);
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。