赞
踩
备忘录
制作物体标识牌时使用
using UnityEngine;
public class LookCamera : MonoBehaviour
{
public Camera camera;
private void FixedUpdate()
{
gameObject.transform.LookAt(camera.transform.position);
gameObject.transform.rotation = Quaternion.Slerp(gameObject.transform.rotation,
Quaternion.LookRotation(camera.transform.position - gameObject.transform.position),
10 * Time.deltaTime);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。