90 lines
2.7 KiB
C#
90 lines
2.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using static InterfaceManager;
|
|
using RDate;
|
|
using UnityEngine.UI;
|
|
|
|
public class DoublePlayMain : MonoBehaviour
|
|
{
|
|
public static DoublePlayMain instance;
|
|
/// <summary>
|
|
/// 所有房间数据接口
|
|
/// </summary>
|
|
[Header("所有房间数据接口")]
|
|
public RoomData roomdata = new RoomData();
|
|
/// <summary>
|
|
/// 复盘回访预制体
|
|
/// </summary>
|
|
[Header("复盘回访预制体")]
|
|
public GameObject DuplexPrefab;
|
|
/// <summary>
|
|
/// 复盘回访预制体父物体
|
|
/// </summary>
|
|
[Header("复盘回访预制体父物体")]
|
|
public Transform DuplexPrefabParent;
|
|
/// <summary>
|
|
/// 基本信息 脚本
|
|
/// </summary>
|
|
public DoublePlayIntroduceList doublePlayIntroduceList;
|
|
/// <summary>
|
|
/// 训练评估 脚本
|
|
/// </summary>
|
|
public DoublePlayEvaluatePanel doublePlayEvaluatePanel;
|
|
/// <summary>
|
|
/// 基本信息tog
|
|
/// </summary>
|
|
private Toggle tog_informition;
|
|
/// <summary>
|
|
/// 训练评估tog
|
|
/// </summary>
|
|
private Toggle tog_evaluate;
|
|
/// <summary>
|
|
/// 训练回放
|
|
/// </summary>
|
|
private Button btn_video;
|
|
/// <summary>
|
|
/// 基本信息obj
|
|
/// </summary>
|
|
public GameObject IntroduceList;
|
|
/// <summary>
|
|
/// 训练评估obj
|
|
/// </summary>
|
|
public GameObject EvaluatePanel;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
instance = this;
|
|
Debug.Log("url.:"+ Url_RoomList);
|
|
tog_informition = transform.Find("IntroducePanel/tog_informition").GetComponent<Toggle>();
|
|
tog_evaluate = transform.Find("IntroducePanel/tog_evaluate").GetComponent<Toggle>();
|
|
StartCoroutine(GetString(Url_RoomList, data => {
|
|
Debug.Log(data);
|
|
roomdata= JsonUtility.FromJson<RoomData>(data);
|
|
for (int i = 0; i < roomdata.data.Count; i++)
|
|
{
|
|
GameObject obj = Instantiate(DuplexPrefab, DuplexPrefabParent);
|
|
DropdownDouble dropdownDouble = obj.GetComponent<DropdownDouble>();
|
|
if (dropdownDouble)
|
|
{
|
|
dropdownDouble.dataItem = roomdata.data[i];
|
|
//Debug.Log(roomdata.data[i].Name);
|
|
dropdownDouble.Label = roomdata.data[i].Name;
|
|
}
|
|
obj.SetActive(true);
|
|
}
|
|
}));
|
|
tog_informition.onValueChanged.AddListener(isOn => {
|
|
IntroduceList.transform.localScale = isOn ? Vector3.one : Vector3.zero;
|
|
EvaluatePanel.transform.localScale = isOn ? Vector3.zero : Vector3.one;
|
|
}
|
|
);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|