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

52 lines
723 B
C#
Raw Normal View History

2024-12-11 14:24:06 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TaskItem : MonoBehaviour
{
2024-12-11 14:24:06 +08:00
public JSONReader jr;
public int id;
public Text tasktxt;
2024-12-11 14:24:06 +08:00
// Start is called before the first frame update
void Start()
{
}
2024-12-11 14:24:06 +08:00
private void OnClickButton()
{
}
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()
{
}
}