68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
using UnityEngine.UI;
|
|
|
|
public class ShowPractices : MonoBehaviour
|
|
{
|
|
public List<GameObject> List_Task;
|
|
string PracticesName;
|
|
int i;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
PracticesName = PlayerPrefs.GetString("Practices");
|
|
Debug.Log("PracticesName:" + PracticesName);
|
|
Invoke("wait", .5f);
|
|
}
|
|
void wait()
|
|
{
|
|
//隐藏所有项
|
|
for (i = 0; i < List_Task.Count; i++)
|
|
List_Task[i].SetActive(false);
|
|
//for (i = 1; i <= 10; i++)
|
|
{
|
|
int a = 0;
|
|
if (PracticesName != "")
|
|
{
|
|
for (int j = 0; j < ReadExamData.Instance.List_TaskTitle.Count; j++)
|
|
{
|
|
if (ReadExamData.Instance.List_TaskTitle[j].Contains(PracticesName))
|
|
{
|
|
a++;
|
|
List_Task[a].gameObject.SetActive(true);
|
|
List_Task[a].transform.GetChild(0).GetComponent<Text>().text = ReadExamData.Instance.List_TaskTitle[j];
|
|
}
|
|
}
|
|
|
|
|
|
//if (PlayerPrefs.GetInt("Join_" + i) == 1)//已参加
|
|
//{
|
|
// List_Task[i - 1].transform.GetComponent<Button>().interactable = false;
|
|
// List_Task[i - 1].transform.GetChild(1).gameObject.SetActive(false);
|
|
// List_Task[i - 1].transform.GetChild(2).gameObject.SetActive(true);
|
|
//}
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SelectTask(Text taskText)
|
|
{
|
|
PlayerPrefs.SetString("Task", taskText.text);
|
|
SceneManager.LoadScene("Leader");
|
|
}
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public void Exit()
|
|
{
|
|
Application.Quit();
|
|
//Dictionary<string, string> formDic = new Dictionary<string, string>();
|
|
//formDic.Add("ip", InterfaceData.GetIP(ADDRESSFAM.IPv4));
|
|
//StartCoroutine(InterfaceData.UnityWebRequestPost("http://jc.lgzn.space/api/api/pro/deleteOperateTaskInfo", formDic, text => { }));
|
|
}
|
|
}
|