_xiaofang/xiaofang/Assets/Script/task/task.cs

39 lines
639 B
C#
Raw Normal View History

2024-10-21 17:21:28 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class task : MonoBehaviour
{
2024-12-11 14:24:06 +08:00
private Text taskte;
2024-10-21 17:21:28 +08:00
private float timer = 0;
2024-12-11 14:24:06 +08:00
2024-10-21 17:21:28 +08:00
private void Start()
{
taskte = this.GetComponent<Text>();
2024-12-11 14:24:06 +08:00
2024-10-21 17:21:28 +08:00
}
private void Update()
{
timer += Time.deltaTime;
if (timer>1 && TaskMgr.instance.taskbool)
{
TaskMgr.instance.setText(taskte);
timer = 0;
}
//taskte.text = Time.deltaTime.ToString("F2");
//Debug.Log(taskte.text);
}
2024-12-11 14:24:06 +08:00
public void SetInfo()
{
2024-10-21 17:21:28 +08:00
2024-12-11 14:24:06 +08:00
}
2024-10-21 17:21:28 +08:00
}