using System.Collections; using System.Collections.Generic; using System.Linq; using TMPro; using UnityEngine; using UnityEngine.UI; public class NPC_Attach10002_2002 : NPC_Attach_Base { [HideInInspector] public NPCController header; [HideInInspector] public NPCController custom; public int headTalkIndex; public int customIndex; private void Awake() { var npcs = GameObject.FindObjectsOfType().ToList(); header = npcs.Find(a => a.triggerName == "NPC负责人"); custom = npcs.Find(a => a.triggerName == "NPC客户"); if (header != null) header.talkAction += HeadTalk; if (custom != null) custom.talkAction += CustomTalk; } public void Init() { headTalkIndex = 0; customIndex = 0; header.spriteRenderer.gameObject.SetActive(true); custom.spriteRenderer.gameObject.SetActive(true); } /// /// 工作负责人对话 /// private void HeadTalk() { } /// /// 客户对话 /// private void CustomTalk() { //if (ProcessManager.Instance.IsRightSubProcessStepsTriggerID(custom.triggerName, false) == 0) //{ if (customIndex == 0) { //与客户沟通 GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (panel) => { panel.Init(custom.triggerName, "拿取工具。", "指导老师", 0, (intTemp) => { List items2 = ToolAndmaterialMgr.Instance.CreateItemInfoByName(new List { "放大镜","剪刀","解剖刀","镊子" }); items2.ForEach(item => { PacksackBagMgr.Instance.AddOneToolOrMater(item); }); ProcessManager.Instance.IsRightSubProcessStepsTriggerID(custom.triggerName, true); custom.StopAnimator(); customIndex++; }); }); } //else if (customIndex == 1) //{ // //断电后对话 // if ((LiveSceneManager.Instance.device_Control as Device_Control_2002).outSwitch.isOpen == false) // { // GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (panel) => // { // panel.Init(custom.triggerName, "您好,截止到目前,您家累计用电量是891.34度。", "客户", 0, (intTemp) => // { // ProcessManager.Instance.IsRightSubProcessStepsTriggerID(custom.triggerName, true); // custom.StopAnimator(); // customIndex++; // ScoreManager.instance.Check("告知用户电量", null); // }); // }); // } //} //else if (customIndex == 2) //{ // //现场完工 // Device_Control_2002 dc = LiveSceneManager.Instance.device_Control as Device_Control_2002; // if (!dc.sundries.gameObject.activeInHierarchy && !dc.meteringDevice.gameObject.name.Contains("原") && !dc.meteringDevice.cover.cover_seal_Left.isCut && !dc.meteringDevice.cover.cover_seal_Right.isCut) // { // GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (panel) => // { // //弹出告知单 // GameManager.UIMgr.ShowPanel(); // panel.Init("自己", "感谢您对我们工作的支持,如果您日后在用电方面有什么疑问需求的,可以来电向我们咨询,这是我们台区经理的联系方式,请您惠存,谢谢!", (intTemp) => // { // GameManager.UIMgr.ShowPanel(E_UI_Layer.Mid, (panel) => // { // panel.Init(custom.triggerName, "已签字确认", "客户", 0, intTemp => // { // GameManager.UIMgr.HidePanel(); // ProcessManager.Instance.IsRightSubProcessStepsTriggerID(custom.triggerName, true); // custom.StopAnimator(); // customIndex++; // ScoreManager.instance.Check("现场完工", null); // }); // }); // }, 0); // }); // } //} //} } }