|
@@ -19,19 +19,41 @@ public class Item0 : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
|
|
public StaticImportant staticImp;
|
|
|
|
|
|
public GameObject bingObj;
|
|
|
+
|
|
|
+ public Sprite[] images;
|
|
|
// Start is called before the first frame update
|
|
|
void Start()
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- public void InitPoint(Sprite newIcon, string name_pri, string newText,string special)
|
|
|
+ public void InitPoint(Sprite newIcon, string name_pri, string newText, string special)
|
|
|
{
|
|
|
- if (special != "1") {
|
|
|
+ if (special != "1")
|
|
|
+ {
|
|
|
bg.gameObject.SetActive(false);
|
|
|
this.GetComponentInChildren<Button>().targetGraphic = nameText;
|
|
|
this.GetComponent<RectTransform>().sizeDelta = new Vector2(this.GetComponent<RectTransform>().sizeDelta.x, 70);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ switch (name_pri)
|
|
|
+ {
|
|
|
+ case "BuYuan":
|
|
|
+ pic.GetComponent<Image>().sprite = images[0];
|
|
|
+ break;
|
|
|
+ case "TaoKou":
|
|
|
+ pic.GetComponent<Image>().sprite = images[1];
|
|
|
+ break;
|
|
|
+ case "YaoKou":
|
|
|
+ pic.GetComponent<Image>().sprite = images[2];
|
|
|
+ break;
|
|
|
+ case "GeTi":
|
|
|
+ pic.GetComponent<Image>().sprite = images[3];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
nameText.text = newText;
|
|
|
if (name_pri.Trim().Length > 0)
|
|
|
{
|
|
@@ -47,9 +69,12 @@ public class Item0 : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
|
|
if (CameraManager.instance.mainCamera.GetComponent<CameraBird>().onScroll)
|
|
|
{
|
|
|
pic.GetComponent<Image>().raycastTarget = false;
|
|
|
+ nameText.raycastTarget = false;
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
pic.GetComponent<Image>().raycastTarget = true;
|
|
|
+ nameText.raycastTarget = true;
|
|
|
}
|
|
|
this.GetComponent<RectTransform>().anchoredPosition = CameraManager.instance.mainCamera.WorldToScreenPoint(bingObj.transform.position) * 1920.0f / Screen.width;
|
|
|
|
|
@@ -64,7 +89,7 @@ public class Item0 : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
|
|
|
if (eventData.button == PointerEventData.InputButton.Left)
|
|
|
{
|
|
|
lastTime = Time.time;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|