Merge branch 'U3D' of http://172.16.1.12/huangjiayu/EnergyEfficiencyManagement into U3D
This commit is contained in:
commit
7976599568
|
|
@ -1 +1 @@
|
|||
2026-04-09 15:04:24#'efficiencymanagement://31,56,118,1,3,1491816028567502848,eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjRjMDhjMTAyLTAxY2ItNDg5NS1iNjZjLWIzMDJkMmU4YzgyYSJ9.OdzdjH7kB7-NzSB0vQM_K90wUga7yr24hqau15l54rAwoSYMhMDpXTs6Gl9e_vEJqmG9FAvcOOe3mH4ae5Piog,&/#116;est1212,10001,172.16.1.135:8081,60'|
|
||||
2026-04-09 17:40:09#'efficiencymanagement://31,56,118,1,3,1491855224107696128,eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjdhZjBkZGRjLWYwNTItNGY5My04YjU5LTViYzI4ZmQ0MjY2MyJ9.rsd9IYB4lfb32egQ8aEcg9L00b0m-6uueWCGB3AhDt_po1c8lpu2j5l55wo2jiBxltDrzndZiBZASNXSJ8KykA,&/#116;est1212,10001,172.16.1.135:8081,60'|
|
||||
|
|
@ -13,7 +13,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
public List<TaskStep> taskStep = new List<TaskStep>();
|
||||
public int firstStep = 0;
|
||||
public int secondStep = 0;
|
||||
private int currentStep;
|
||||
public int currentStep;
|
||||
public bool currentState;
|
||||
void Awake()
|
||||
{
|
||||
|
|
@ -21,11 +21,13 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
currentStep = firstStep;
|
||||
taskStep.Add(new TaskStep { StepId = firstStep, Description = "开启" + transform.name });
|
||||
taskStep.Add(new TaskStep { StepId = secondStep, Description = "关闭" + transform.name });
|
||||
|
||||
}
|
||||
|
||||
void OnMouseDown()
|
||||
{
|
||||
if (EventSystem.current.IsPointerOverGameObject()) return;
|
||||
EquipmentProcessExample_TSQ.Instance.currentEquipment = this;
|
||||
switch (gameObject.name)
|
||||
{
|
||||
case "冷却塔风机1":
|
||||
|
|
@ -62,7 +64,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
if (EquipmentProcessExample_TSQ.Instance._expectStepIndex > EquipmentProcessExample_TSQ.Instance.EquipmentProcess_Task.Steps.Count) return;
|
||||
bool isError = currentStep != EquipmentProcessExample_TSQ.Instance._expectStepIndex;
|
||||
TaskManager.Instance.ReportCurrentStepResult(isError);
|
||||
ScoreManager.Instance?.GetScoreBaseBySchemeID(GameManager.RunModelMgr.schemeID).steps[EquipmentProcessExample_TSQ.Instance._expectStepIndex].SetScore(!isError);
|
||||
ScoreManager.Instance.GetScoreBaseBySchemeID(GameManager.RunModelMgr.schemeID).steps[EquipmentProcessExample_TSQ.Instance._expectStepIndex].SetScore(!isError);
|
||||
EquipmentProcessExample_TSQ.Instance._expectStepIndex++;
|
||||
currentStep = secondStep;
|
||||
currentState = state;
|
||||
|
|
@ -77,8 +79,6 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("开启冷却塔风机Text1").text = "开启冷却塔风机1";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-冷却塔风机1").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却塔风机1").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却塔风机1").onClick.AddListener(() => { SetStep(false); });
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[0] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却塔风机1").Deactivate();
|
||||
|
|
@ -104,8 +104,8 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("开启冷却塔风机Text2").text = "开启冷却塔风机2";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-冷却塔风机2").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却塔风机2").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却塔风机2").onClick.AddListener(() => { SetStep(false); });
|
||||
|
||||
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[1] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却塔风机2").Deactivate();
|
||||
|
|
@ -131,8 +131,6 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("启动冷却水循环泵1Text").text = "启动冷却水循环泵";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-冷却泵1").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却泵1").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却泵1").onClick.AddListener(() => { SetStep(false); });
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[2] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却泵1").Deactivate();
|
||||
|
|
@ -156,8 +154,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("启动冷却水循环泵2Text").text = "启动冷却水循环泵";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-冷却泵2").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却泵2").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却泵2").onClick.AddListener(() => { SetStep(false); });
|
||||
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[3] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却泵2").Deactivate();
|
||||
|
|
@ -181,8 +178,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("启动风机盘管Text1").text = "启动风机盘管1";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-风机盘管1").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-风机盘管1").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-风机盘管1").onClick.AddListener(() => { SetStep(false); });
|
||||
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[4] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-风机盘管1").Deactivate();
|
||||
|
|
@ -206,8 +202,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("启动风机盘管Text2").text = "启动风机盘管2";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-风机盘管2").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-风机盘管2").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-风机盘管2").onClick.AddListener(() => { SetStep(false); });
|
||||
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[5] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-风机盘管2").Deactivate();
|
||||
|
|
@ -232,8 +227,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
UIView.Get<EquipmentSimulationView>().variables.Get<Text>("中央空调主机Text").text = "启动中央空调主机";
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<RectTransform>("参数面板-中央空调主机").Activate();
|
||||
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-中央空调主机").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-中央空调主机").onClick.AddListener(() => { SetStep(false); });
|
||||
|
||||
if (UIView.Get<EquipmentSimulationView>().Stepbools[6] == true)
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-中央空调主机").Deactivate();
|
||||
|
|
@ -248,6 +242,7 @@ public class EquipmentIIntroduction_TSQ : MonoBehaviour
|
|||
//StartCoroutine(AutoHide(4,"参数面板-中央空调主机"));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 自动隐藏运行成功信息协程,延迟一段时间后关闭框。
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using SK.Framework;
|
||||
using UnityEngine.UI;
|
||||
|
||||
/// <summary>
|
||||
/// 操作流程
|
||||
|
|
@ -9,6 +10,8 @@ using SK.Framework;
|
|||
public class EquipmentProcessExample_TSQ : MonoSingleton<EquipmentProcessExample_TSQ>
|
||||
{
|
||||
public TaskData EquipmentProcess_Task;
|
||||
|
||||
public EquipmentIIntroduction_TSQ currentEquipment;
|
||||
/// <summary>
|
||||
/// 当前期望输入的 Step 索引(0-based)
|
||||
/// 仅用于示例判断“是否按对”,不控制流程
|
||||
|
|
@ -48,12 +51,12 @@ public class EquipmentProcessExample_TSQ : MonoSingleton<EquipmentProcessExample
|
|||
}
|
||||
BubbleSortList();
|
||||
|
||||
|
||||
EquipmentProcess_Task.OnTaskStarted += OnTaskStarted;
|
||||
|
||||
TaskManager.Instance.SetMode(TaskMode.Exam);
|
||||
TaskManager.Instance.AddTask(EquipmentProcess_Task);
|
||||
TaskManager.Instance.Start();
|
||||
InitButtonAction();
|
||||
|
||||
}
|
||||
void BubbleSortList()
|
||||
|
|
@ -150,4 +153,33 @@ public class EquipmentProcessExample_TSQ : MonoSingleton<EquipmentProcessExample
|
|||
Debug.Log("任务开始,等待操作输入");
|
||||
_expectStepIndex = 1;
|
||||
}
|
||||
|
||||
private void InitButtonAction()
|
||||
{
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却塔风机1").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却塔风机1").onClick.AddListener(() => { SetStep(false); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-风机盘管1").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-风机盘管1").onClick.AddListener(() => { SetStep(false); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-风机盘管2").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-风机盘管2").onClick.AddListener(() => { SetStep(false); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却泵2").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却泵2").onClick.AddListener(() => { SetStep(false); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却泵1").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却泵1").onClick.AddListener(() => { SetStep(false); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-冷却塔风机2").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-冷却塔风机2").onClick.AddListener(() => { SetStep(false); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("启动运行-中央空调主机").onClick.AddListener(() => { SetStep(true); });
|
||||
UIView.Get<EquipmentSimulationView>().variables.Get<Button>("停止运行-中央空调主机").onClick.AddListener(() => { SetStep(false); });
|
||||
}
|
||||
|
||||
private void SetStep(bool state)
|
||||
{
|
||||
if (EquipmentProcessExample_TSQ.Instance._expectStepIndex > EquipmentProcessExample_TSQ.Instance.EquipmentProcess_Task.Steps.Count) return;
|
||||
bool isError = currentEquipment.currentStep != EquipmentProcessExample_TSQ.Instance._expectStepIndex;
|
||||
TaskManager.Instance.ReportCurrentStepResult(isError);
|
||||
ScoreManager.Instance.GetScoreBaseBySchemeID(GameManager.RunModelMgr.schemeID).steps[EquipmentProcessExample_TSQ.Instance._expectStepIndex].SetScore(!isError);
|
||||
EquipmentProcessExample_TSQ.Instance._expectStepIndex++;
|
||||
currentEquipment.currentStep = currentEquipment.secondStep;
|
||||
currentEquipment.currentState = state;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue