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));
}
}
|