using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TaskPointIcon : MonoBehaviour { public Material mat; public Camera _Camera; public Transform quadT; public Transform root; private void Awake() { quadT = root.transform.Find("Quad"); mat = quadT.GetComponent().material; _Camera=Camera.main; } private void Update() { quadT.LookAt(_Camera.transform); float distance = Vector3.Distance(CameraManager.instance.mainCamera.transform.position, this.transform.position); root.transform.localScale = Vector3.one * distance / 20; } public void SetHeightLight(bool isHeightLight) { mat.SetColor("_Color",isHeightLight?new Color(1,1,1,1):new Color(1,1,1,0.5f)); } }