45 lines
1.6 KiB
C#
45 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using TMPro;
|
|
public class ChartManager : MonoBehaviour
|
|
{
|
|
public GameObject 故障记录表;
|
|
//public TMP_Dropdown 地区;
|
|
public Dropdown 设备;
|
|
public Dropdown 详细缺陷;
|
|
public Dropdown 缺陷类型;
|
|
public GameObject content;
|
|
//public List<chartbase> chartbases = new List<chartbase>();
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public void 新增() {
|
|
var load = Resources.Load("Prefab/条目");
|
|
Debug.Log(load);
|
|
GameObject 条目 = Instantiate(load) as GameObject;
|
|
条目.transform.SetParent(content.transform);
|
|
条目.transform.localScale = new Vector3(1, 1, 1);
|
|
条目.transform.localPosition = new Vector3(0, 0, 0);
|
|
条目.transform.localEulerAngles = new Vector3(0, 0, 0);
|
|
//条目.GetComponent<chartbase>().地区.text = 地区.options[地区.value].text;
|
|
//条目.GetComponent<chartbase>().地区_value = 地区.value;
|
|
条目.GetComponent<chartbase>().设备.text = 设备.options[设备.value].text;
|
|
条目.GetComponent<chartbase>().设备_value = 设备.value;
|
|
条目.GetComponent<chartbase>().详细缺陷.text = 详细缺陷.options[详细缺陷.value].text;
|
|
条目.GetComponent<chartbase>().详细缺陷_value = 详细缺陷.value;
|
|
条目.GetComponent<chartbase>().缺陷类型.text = 缺陷类型.options[缺陷类型.value].text;
|
|
条目.GetComponent<chartbase>().缺陷类型_value = 缺陷类型.value;
|
|
//chartbases.Add(条目.GetComponent<chartbase>());
|
|
}
|
|
}
|