31 lines
924 B
C#
31 lines
924 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class LandMarksAndInfoController : MonoBehaviour
|
|
{
|
|
public TMP_Text tmpText;
|
|
public Transform infoItemPrefab;
|
|
public TMP_Text infoItemText;
|
|
public RectTransform infoTextContent;
|
|
|
|
|
|
public void SetMarksInfo(string lnadName, List<string> landLoadInfos, bool isShowCityName = true)
|
|
{
|
|
tmpText.text = lnadName;
|
|
for (int i = 1; i < infoTextContent.childCount; i++)
|
|
{
|
|
Destroy(infoTextContent.GetChild(i).gameObject);
|
|
}
|
|
infoTextContent.GetChild(0).gameObject.SetActive(isShowCityName);
|
|
for (int i = 0; i < landLoadInfos.Count; i++)
|
|
{
|
|
Transform rt = Instantiate(infoItemPrefab, infoTextContent);
|
|
infoItemText = rt.GetComponentInChildren<TMP_Text>();
|
|
infoItemText.text = landLoadInfos[i];
|
|
}
|
|
}
|
|
|
|
}
|