_xiaofang/xiaofang/Assets/Prefabs/HYLPrefabs/TaskItem.cs

42 lines
643 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TaskItem : MonoBehaviour
{
public JSONReader jr;
public int id;
public Text tasktxt;
// Start is called before the first frame update
void Start()
{
}
public void SetInfo(int id,JSONReader js)
{
this.id = id;
jr = js;
UpdateTxt();
}
void UpdateTxt()
{
Language info = jr.GetTaskByID(id,jr.LanguageDictionary);
tasktxt.text = info.Text;
}
// Update is called once per frame
void Update()
{
}
}