赞
踩
-
- using ET;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
- public class LookatPlayer : MonoBehaviour
- {
- CameraComponent cameraCom;
- void Awake()
- {
- cameraCom = Game.Scene.GetComponent<CameraComponent>();
- if (cameraCom == null)
- {
- Debug.LogError("û���ҵ�CameraComponent");
- return;
- }
- }
-
- // Update is called once per frame
- void Update()
- {
- this.transform.LookAt(cameraCom.CurrCamera.Camera.transform);
- // this.transform.forward = Vector3.forward;
- this.transform.localRotation = Quaternion.Euler(new Vector3(0, this.transform.localRotation.eulerAngles.y, 0));
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。