using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class WeatherUnit : MonoBehaviour { public Text nameText; public Text weatherText; public Image image; public GameObject[] weatherSprite; public GameObject bingObj; // Start is called before the first frame update void Start() { } public void Init(double lgtd, double lttd, string na, string we) { for (int i = 0; i < weatherSprite.Length; i++) { weatherSprite[i].gameObject.SetActive(false); } Vector3 temp = CoordinateConverter.GeoToUGUISmall(lgtd, lttd); this.GetComponent().anchoredPosition3D = temp; nameText.text = na.Trim(); //digitText.text = di; switch (we) { case "9": weatherText.text = "ÇçÌì"; weatherSprite[0].gameObject.SetActive(true); break; case "8": weatherText.text = "ÒõÌì"; weatherSprite[1].gameObject.SetActive(true); break; case "7": weatherText.text = "ÓêÌì"; weatherSprite[2].gameObject.SetActive(true); break; case "6": weatherText.text = "Óê¼ÐÑ©"; weatherSprite[3].gameObject.SetActive(true); break; case "5": weatherText.text = "Ñ©Ìì"; weatherSprite[4].gameObject.SetActive(true); break; } } // Update is called once per frame void Update() { this.GetComponent().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width; } }