CultivationOfBrewing-2/Assets/Scripts/Project/Objects/Other/NPC_Attach10002_2002.cs

115 lines
4.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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<NPCController>().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);
}
/// <summary>
/// 工作负责人对话
/// </summary>
private void HeadTalk()
{
}
/// <summary>
/// 客户对话
/// </summary>
private void CustomTalk()
{
//if (ProcessManager.Instance.IsRightSubProcessStepsTriggerID(custom.triggerName, false) == 0)
//{
if (customIndex == 0)
{
//与客户沟通
GameManager.UIMgr.ShowPanel<UI_CustomSessionPanel>(E_UI_Layer.Mid, (panel) =>
{
panel.Init(custom.triggerName, "拿取工具。", "指导老师", 0, (intTemp) =>
{
List<ItemInfo> items2 = ToolAndmaterialMgr.Instance.CreateItemInfoByName(new List<string> { "放大镜","剪刀","解剖刀","镊子" });
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<UI_CustomSessionPanel>(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<UI_PlayerSessionPanel>(E_UI_Layer.Mid, (panel) =>
// {
// //弹出告知单
// GameManager.UIMgr.ShowPanel<UI_DisassemblyAssemblyNoticePanel>();
// panel.Init("自己", "感谢您对我们工作的支持,如果您日后在用电方面有什么疑问需求的,可以来电向我们咨询,这是我们台区经理的联系方式,请您惠存,谢谢!", (intTemp) =>
// {
// GameManager.UIMgr.ShowPanel<UI_CustomSessionPanel>(E_UI_Layer.Mid, (panel) =>
// {
// panel.Init(custom.triggerName, "已签字确认", "客户", 0, intTemp =>
// {
// GameManager.UIMgr.HidePanel<UI_DisassemblyAssemblyNoticePanel>();
// ProcessManager.Instance.IsRightSubProcessStepsTriggerID(custom.triggerName, true);
// custom.StopAnimator();
// customIndex++;
// ScoreManager.instance.Check("现场完工", null);
// });
// });
// }, 0);
// });
// }
//}
//}
}
}