|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class DataSetPanel : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
[HideInInspector]
|
|
|
|
|
public GameObject currentIcon;
|
|
|
|
|
private int currentCount=1;
|
|
|
|
|
public int aearCount;
|
|
|
|
|
public GameObject DataPanel;
|
|
|
|
|
public InputField[] inputs;
|
|
|
|
|
public GameObject DataInfoPanel;
|
|
|
|
|
[Header("区域组")]
|
|
|
|
|
public GameObject[] aears;
|
|
|
|
|
|
|
|
|
|
private void Start()
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < aears.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
aears[i].SetActive(false);
|
|
|
|
|
Debug.Log("隐藏");
|
|
|
|
|
}
|
|
|
|
|
OpenDataSetIcon();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void OpenDataSetIcon()
|
|
|
|
|
{
|
|
|
|
|
DragCheck[] dragChecks = GameObject.FindObjectsOfType<DragCheck>();
|
|
|
|
|
for (int i = 0; i < dragChecks.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (dragChecks[i].isPlace)
|
|
|
|
|
{
|
|
|
|
|
int index = dragChecks[i].id-1;
|
|
|
|
|
aears[index].gameObject.SetActive(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
GameRoot.Instance.menuWindow.FangZhiAear.SetActive(false);
|
|
|
|
|
}
|
|
|
|
|
public void OpenDataSetPanel()
|
|
|
|
|
{
|
|
|
|
|
DataPanel.SetActive(true);
|
|
|
|
|
for (int i = 0; i < inputs.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
inputs[i].text = "";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetCurrentIcon(GameObject obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj != null)
|
|
|
|
|
{
|
|
|
|
|
currentIcon = obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void ShowCurrentIcon()
|
|
|
|
|
{
|
|
|
|
|
if (currentIcon == null) return;
|
|
|
|
|
for (int i = 0; i < inputs.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (inputs[i].text == "")
|
|
|
|
|
{
|
|
|
|
|
GameRoot.Instance.AddTipQueue("请完成未填写的参数");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DataPanel.SetActive(false);
|
|
|
|
|
currentIcon.SetActive(true);
|
|
|
|
|
currentIcon = null;
|
|
|
|
|
|
|
|
|
|
if (currentCount == aearCount)
|
|
|
|
|
{
|
|
|
|
|
//关闭设置面板,显示数据面板
|
|
|
|
|
DataInfoPanel.SetActive(true);
|
|
|
|
|
this.gameObject.SetActive(false);
|
|
|
|
|
GameRoot.Instance.OverTip.gameObject.SetActive(true);
|
|
|
|
|
EduCoderTool.WebConnecter.Singleton.SendResultToWeb(true);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
currentCount++;
|
|
|
|
|
Debug.Log(currentCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|