using System.Collections; using System.Collections.Generic; using UnityEngine; public class ReadXMLWaiXiang : MonoBehaviour { public GameObject inspectListObj; // 保存所有的从XML读取的数据 public ArrayList m_enemylist; // 存储敌人出场顺序的XML public TextAsset xmldata; public InspectList inspecyList; public InspectListPanel inspectListPanel; protected int m_index = 0; protected Transform startPos; public GameObject objParent; public GameObject excel_buttom; public int idtype; void Awake() { // 读取XML ReadMyXML(); inspectListObj = Instantiate(excel_buttom);// Resources.Load("excel_buttom") as GameObject; } public virtual void Start() { LoadInspectList(); } public virtual void ReadMyXML() { m_enemylist = new ArrayList(); switch (idtype) { case 0: setDATA("1", "检查USB3.0接口线", "0", "excel_dikuang_1", "请检查USB3.0接口线是否插入主板又部的USB3.0针脚上。", "外箱", "ResultView1", "1", "1S20QEZ4KYUSPF1P4Q21"); setDATA("2", "检查F_PANEL接口线", "0", "excel_dikuang_2", "请检查主板右下方的JFP1接口,即F_PANEL接口是否与控制前置面板开关及指示灯的线连接。", "外箱", "ResultView2", "1", "SPF1P4Q21"); setDATA("3", "检查风扇运转情况", "0", "excel_dikuang_3", "请检查机箱上的二维码是否破损。", "外箱", "ResultView3", "2", "0"); setDATA("4", "外箱", "0", "excel_dikuang_4", "请将主机通电,是否并按下开机键,查看风扇是否正常转动并发光", "外箱", "ResultView4", "1", "193386983477"); setDATA("5", "检查主板供电发光线", "0", "excel_dikuang_5", "请检查24pin主板供电线是否插入主板右侧的24pin供电插槽内,并发出炫彩光效", "外箱", "ResultView5", "1", "015184006299197"); break; case 1: setDATA("6", "打开设备包装", "0", "excel_dikuang_1", "开箱前检测,请带上手套,做好防尘措施.扫描设备配置单ModelS/N二维码,确认设备机型开始检测流程", "附件", "ResultView1", "1", "1S20QEZ4KYUSPF1P4Q21"); setDATA("7", "清点相关配件", "0", "excel_dikuang_2", "扫描Serial Number,确认二维码与系统数据一致", "附件", "ResultView2", "1", "SPF1P4Q21"); setDATA("8", "扫描电源线二维码", "0", "excel_dikuang_3", "请人工对比ES LOGO是否有图改,表面有无损毁", "附件", "ResultView3", "2", "0"); setDATA("9", "扫描扫描适配器二维码 code", "0", "excel_dikuang_4", "扫描UPC code,确认二维码与系统数据一致", "附件", "ResultView4", "1", "193386983477"); setDATA("10", "扫描VGA CABLE二维码", "0", "excel_dikuang_5", "扫描IMEI,确认二维码与系统数据一致,", "附件", "ResultView5", "1", "015184006299197"); setDATA("11", "扫描产品手册二维码", "0", "excel_dikuang_6", "请人工对比FCC logo是否有图改,表面有无损毁,", "附件", "ResultView6", "2", "0"); setDATA("12", "扫描IJ45 二维码", "0", "excel_dikuang_7", "请人工对比是否与图片一致,正面X1 logo和ThinkPad logo,反面防火logo是否有图改,表面有无损毁", "附件", "ResultView7", "2", "0"); break; case 2: setDATA("13", "进行产品配置检查", "0", "excel_dikuang_1", "检查产品正面是否有X1图片和产品logo,是否有图改,表面有无损毁", "配置", "ResultView1", "1", "1S20QEZ4KYUSPF1P4Q21"); setDATA("14", "请检查屏幕及双摄像头", "0", "excel_dikuang_2", "请检查设备内部显示屏幕是否有划痕与指纹印记,检查双摄像头是否有划痕", "配置", "ResultView2", "1", "SPF1P4Q21"); setDATA("15", "请检查掌托面-UPPER", "0", "excel_dikuang_3", "请检查设备掌托面-UPPER,确认触控板有弹性", "配置", "ResultView3", "2", "0"); setDATA("16", "请检查掌托右侧指纹识别 code", "0", "excel_dikuang_4", "请检查掌托右侧指纹识别,是否有划痕与指纹印记", "配置", "ResultView4", "1", "193386983477"); setDATA("17", "请检查掌托左侧Inter标签", "0", "excel_dikuang_5", "请检查掌托左侧Inter标签,是否有图改或者表面损毁", "配置", "ResultView5", "1", "015184006299197"); setDATA("18", "请检查SN码与IMEI", "0", "excel_dikuang_6", "请翻转到底部,检查底座-SN码与IMEI标志是否有图改,表面有无损毁", "配置", "ResultView6", "2", "0"); setDATA("19", "请检查底部windows标签", "0", "excel_dikuang_7", "请检查底部windows标签,是否有划痕与指纹印记", "配置", "ResultView7", "2", "0"); break; } } public void setDATA(string id, string subtasks, string taskStatus, string pos, string content, string mainSubtasks, string endResultViewPos, string tag,string code) { SpawnData mData = new SpawnData(); mData.id = int.Parse(id); mData.subtasks = subtasks; mData.taskStatus = int.Parse(taskStatus); mData.pos = pos; mData.content = content; mData.mainSubtasks = mainSubtasks; mData.endResultViewPos = endResultViewPos; mData.tag = int.Parse(tag); mData.code = code; m_enemylist.Add(mData); } //public virtual void Update() //{ // if (m_index >= m_enemylist.Count) // return; // //LoadInspectList(); //} private void LoadInspectList() { if (m_index >= m_enemylist.Count) return; for (int i = 0; i < m_enemylist.Count; i++) { SpawnData data = (SpawnData)m_enemylist[m_index]; startPos = inspecyList.listParent.transform.Find(data.pos).gameObject.transform; GameObject obj = Instantiate(inspectListObj, new Vector3(startPos.position.x, startPos.position.y, startPos.position.z), Quaternion.Euler(0, startPos.eulerAngles.y, -90)); obj.transform.parent = objParent.transform; // obj.transform.localScale = new Vector3(0.6086614f, 3.158592f, 8778199f); obj.name = "excel_buttom" + data.id.ToString(); InspectList_Button inB = obj.GetComponent(); inB.text_num.text = data.id.ToString(); inB.text_name.text = data.subtasks.ToString(); inB.status = data.taskStatus; inB.content = data.content; inB.mainSubtasks = data.mainSubtasks; inB.endResultViewPos = data.endResultViewPos; inB.viewTag = data.tag; inB.code = data.code; inspectListPanel.taskList.Add(obj); m_index++; } } public class SpawnData { //id public int id; //子任务 public string subtasks; //子任务状态 public int taskStatus; //子任务位置 public string pos; //子任务的具体内容 public string content; //子任务的标题 public string mainSubtasks; //结算列表的view的位置 public string endResultViewPos; //子任务属于 什么判断 1 扫码 2 语音 public int tag; //子任务的根号 public string code; } }