u3d中的Billboard
View Code
1 using UnityEngine; 2 using System.Collections; 3 4 public class BillBoard : MonoBehaviour { 5 6 private Camera cam; 7 void Start () { 8 cam = Camera.mainCamera; 9 } 10 void Update () { 11 Vector3 v = cam.transform.position - transform.position; 12 v.x = v.z = 0.0f; 13 transform.LookAt(cam.transform.position - v); 14 } 15 }