80 lines
1.9 KiB
C#
80 lines
1.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using UnityEngine;
|
|
/// <summary>
|
|
/// 步骤
|
|
/// </summary>
|
|
public class D_SubProcessStep : I_Enter, I_Exit
|
|
{
|
|
public int id;
|
|
public int schemeId;
|
|
public int processId;
|
|
public int subProcessId;
|
|
public string subProcessStepName;
|
|
public bool isPrecondition;
|
|
public string precondition;
|
|
public string triggerID;
|
|
public string tipTitle;
|
|
public float score;
|
|
|
|
public List<string> triggersName;
|
|
|
|
public void Init()
|
|
{
|
|
GetTriggerID();
|
|
ProcessManager.Instance.subProcessStepTriggerID = triggersName[0];
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取目标ID, (后续 toolID 换成 targetID 应该更好点吧)
|
|
/// </summary>
|
|
public void GetTriggerID()
|
|
{
|
|
triggersName = new List<string>();
|
|
if (string.IsNullOrEmpty(triggerID)) return;
|
|
if (triggerID.Contains(','))
|
|
{
|
|
string[] toolIdTemp = triggerID.Split(',');
|
|
for (int i = 0; i < toolIdTemp.Length; i++)
|
|
{
|
|
triggersName.Add(toolIdTemp[i]);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
triggersName.Add(triggerID);
|
|
}
|
|
}
|
|
|
|
public string SceneName()
|
|
{
|
|
if (precondition == "Office")
|
|
return "办公室";
|
|
if (precondition == "ToolRoom")
|
|
return "工具间";
|
|
if (precondition == "Site")
|
|
return "现场";
|
|
return "";
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 进入
|
|
/// </summary>
|
|
public void Enter()
|
|
{
|
|
//GetTriggerID();
|
|
UnityEngine.Debug.Log("进入当前子流程步骤:" + id + "_" + subProcessStepName);
|
|
}
|
|
/// <summary>
|
|
/// 退出
|
|
/// </summary>
|
|
public void Exit()
|
|
{
|
|
//triggersId.Clear();
|
|
//triggersComplete.Clear();
|
|
UnityEngine.Debug.Log("退出当前子流程步骤:" + id + "_" + subProcessStepName);
|
|
}
|
|
}
|