31 lines
723 B
C#
31 lines
723 B
C#
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 Start()
|
|
{
|
|
Instance = this;
|
|
}
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|