E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/tishi_count.cs

64 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class tishi_count : MonoBehaviour
{ public Toggle ;
public GameObject ;
public GameObject ;
private bool start;
public float time =0;
// Start is called before the first frame update
void Start()
{
.onValueChanged.AddListener(starttishi);
}
// Update is called once per frame
void Update()
{
if (start == true)
{
time += Time.deltaTime;
}
if (time > 5) {
start = false;
time = 0;
.SetActive(false);
.SetActive(false);
}
}
public void starttishi(bool change) {
start = true;
time = 0;
if (.isOn == true)
{
.SetActive(true);
.SetActive(false);
///服务记录仪器.colors = ColorBlock.defaultColorBlock;
}
else
{
.SetActive(true);
.SetActive(false);
}
}
}