1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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<int> layerIDs = new List<int>();
- 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<RectTransform>().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width;
- this.GetComponent<RectTransform>().localScale = Vector3.one / CameraManager.instance.secondCamera.GetComponent<CameraBirdSec>().currentDistance * 20;
- }
-
- }
|