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 Sprite[] 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) { Vector3 temp = CoordinateConverter.GeoToUGUISmall(lgtd, lttd); this.GetComponent().anchoredPosition3D = temp; nameText.text = na; //digitText.text = di; switch (we) { case "9": weatherText.text = "ÇçÌì"; image.sprite = weatherSprite[0]; break; case "8": weatherText.text = "ÒõÌì"; image.sprite = weatherSprite[1]; break; case "7": weatherText.text = "ÓêÌì"; image.sprite = weatherSprite[2]; break; case "6": weatherText.text = "Óê¼ÐÑ©"; image.sprite = weatherSprite[3]; break; case "5": weatherText.text = "Ñ©Ìì"; image.sprite = weatherSprite[4]; break; } } // Update is called once per frame void Update() { this.GetComponent().anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width; } }