12345678910111213141516171819202122232425 |
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using UnityEngine;
- using UnityEngine.UI;
- public class DropUnit : MonoBehaviour
- {
- public Text nameText;
- public Text digitText;
- public GameObject bingObj;
- public void Init(double lgtd,double lttd,string na,string di)
- {
- Vector3 temp = CoordinateConverter.GeoToUGUISmall(lgtd, lttd);
- this.GetComponent<RectTransform>().anchoredPosition3D = temp;
- nameText.text = na;
- digitText.text = di;
- }
- void Update()
- {
- this.GetComponent<RectTransform>().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width;
- }
- }
|