You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
946 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ZoneUI : MonoBehaviour
{
public Camera _camera;
public Transform target;
public Vector3 offset=Vector3.zero;
private Vector3 startScale;
public bool isScreen = true;
Vector3 pos;
private void Start()
{
_camera = GameObject.FindGameObjectWithTag("MainViewCamera").GetComponent<Camera>();
startScale = transform.localScale;
}
public void Update()
{
if (isScreen)
{
pos = _camera.WorldToScreenPoint(target.position);
}
else
{
pos = target.position;
transform.localScale = startScale * GameManagerForZhuanWan.Instance.tipScale;
transform.LookAt(_camera.transform);
}
transform.position = pos + offset;
//transform.LookAt(_camera.transform);
}
}