using DefaultNamespace; using MotionFramework; using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class SetValue : MonoBehaviour { public List Textpro = new List(); public List Text_1 = new List(); public List Inputs = new List(); public List Inputs_ = new List(); void Start() { if (Textpro.Count > 0) { for (int i = 0; i < Textpro.Count; i++) { Textpro[i].text = GetTask(Textpro[i].name); } } if (Text_1.Count > 0) { for (int i = 0; i < Text_1.Count; i++) { Text_1[i].text = GetTask(Text_1[i].name); } } if (Inputs.Count > 0) { for (int i = 0; i < Inputs.Count; i++) { Inputs[i].text = GetTask(Inputs[i].name); } } if (Inputs_.Count > 0) { for (int i = 0; i < Inputs_.Count; i++) { Inputs_[i].text = GetTask(Inputs_[i].name); } } } public string GetTask(string Textname) { if (Textname.Contains("数量")) { return GameManager.Instance.marteialnumber.ToString(); } if (Textname.Contains("描述") && !Textname.Contains("拆退(描述)")) { return MotionEngine.GetModule().GetTaskBookValueByMapping("物料描述"); } if (Textname.Contains("拆退(描述)")) { return MotionEngine.GetModule().GetTaskBookValueByMapping("物料描述") + "\t" + GameManager.Instance.marteialnumber + GameManager.Instance.unit; } if (Textname.Contains("单位")) { return GameManager.Instance.unit; } if (Textname.Contains("工厂")) { return MotionEngine.GetModule().GetTaskBookValueByMapping("工厂代码"); } if (Textname.Contains("供应商")) { return ModerController.Instance.checkGoods[0].Manufacturer.text; } if (Textname.Contains("电压等级")) { if (ModerController.Instance.checkGoods[0].name.ToLower().Contains("10kv")) { return "10KV"; } if (ModerController.Instance.checkGoods[0].name.ToLower().Contains("1kv")) { return "1KV"; } else { return ""; } } return ""; } }