using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class RuntimePoint : MonoBehaviour { public Button btn; public Text text; public Image icon; public StaticImportant staticImp; public List layerIDs = new List(); public RectTransform arrow; public GameObject bingObj; void Awake() { arrow.DOLocalMoveY(-40, 1.0f).SetLoops(-1, LoopType.Yoyo); } // Start is called before the first frame update void Start() { } public void InitPoint(Sprite newIcon, string name_pri, string newText) { text.text = newText; if(name_pri.Trim().Length > 0) staticImp = StaticLod.instance.staticImportantsDic[name_pri]; icon.sprite = newIcon; } // Update is called once per frame void Update() { this.GetComponent().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width; this.GetComponent().localScale = Vector3.one / CameraManager.instance.secondCamera.GetComponent().currentDistance * 20; } }