_xiaofang/xiaofang/Assets/Script/UI/ZZZZZZ/Chooselitem8.cs

27 lines
662 B
C#
Raw Normal View History

2024-12-26 18:03:45 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Chooselitem8 : MonoBehaviour
{
public GameObject prefab;
public Transform PrefabTransform;
public Text text;
public static Chooselitem8 Instance;
public JSONReader JSONReader;
public void CreateItem(int ID)
{
GameObject newitem=Instantiate(prefab,PrefabTransform);
foreach (var item in JSONReader.LanguageDictionary)
{
Language languageData = item.Value;
if (languageData.ID==ID)
{
text.text=languageData.Text;
}
}
}
}