1234567891011121314151617181920212223242526272829303132333435 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class SWHeightUnit : MonoBehaviour
- {
- public Text nameText;
- public Text valueText;
- public GameObject bingObj;
- // Start is called before the first frame update
- void Start()
- {
-
- }
- public void Init(string slgtd, string slttd, string na, string we)
- {
- double lgtd = double.Parse(slgtd);
- double lttd = double.Parse(slttd);
- Vector3 temp = CoordinateConverter.GeoToUGUI(lgtd, lttd);
-
- nameText.text = na;
- float value = 0.0f;
- if(float.TryParse(we,out value))
- valueText.text = value.ToString("0.00");
- this.GetComponent<RectTransform>().anchoredPosition3D = temp;
- }
- // Update is called once per frame
- void Update()
- {
- this.GetComponent<RectTransform>().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width;
- }
- }
|