CultivationOfBrewing-2/Assets/Scripts/CXX/UI/InsulatedConductorPanel.cs

82 lines
3.1 KiB
C#

using HighlightPlus;
//using Microsoft.SqlServer.Server;
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.EventSystems;
/// <summary>
/// 绝缘导线ui
/// </summary>
public class InsulatedConductorPanel : MonoBehaviour
{
public GameObject ;
public GameObject 绿;
public GameObject ;
public GameObject ;
private Tool_InsulatedConductor insulatedConductor;
public void Init(Tool_InsulatedConductor insulatedConductor)
{
this.insulatedConductor= insulatedConductor;
if (GameManager.RunModelMgr?.ModeType == E_ModeType.Study)
GameManager.EventMgr.AddEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
}
/// <summary>
/// 选择线(变大)
/// </summary>
/// <param name="obj"></param>
public void Chose(BaseEventData baseEventData)
{
PointerEventData pd =(PointerEventData)baseEventData;
if (GameManager.ProcessMgr.IsRightSubProcessStepsTriggerID("选择" + pd.pointerClick.gameObject.name + "线", true) == 0)
{
.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == ? 1.5f : 1);
绿.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == 绿 ? 1.5f : 1);
.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == ? 1.5f : 1);
.transform.localScale = new Vector3(1, 1, 1) * (pd.pointerClick.gameObject == ? 1.5f : 1);
insulatedConductor.currentChoseLine = pd.pointerClick.gameObject;
}
}
private void OnDestroy()
{
if (GameManager.RunModelMgr?.ModeType == E_ModeType.Study)
GameManager.EventMgr.RemoveEventListener<string>(Enum_EventType.SwitchSubProcessStepTriggerID, SwitchSubProcessStepTriggerID);
}
/// <summary>
/// 提示是高亮
/// </summary>
/// <param name="arg0"></param>
public void SwitchSubProcessStepTriggerID(string arg0)
{
try
{
if (arg0 == "选择红线" || arg0 == "选择绿线" || arg0 == "选择黄线" || arg0 == "选择黑线")
{
.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(arg0 == "选择红线");
绿.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(arg0 == "选择绿线");
.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(arg0 == "选择黄线");
.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(arg0 == "选择黑线");
}
else
{
.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(false);
绿.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(false);
.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(false);
.GetComponentInChildren<ImageTips>(true).gameObject.SetActive(false);
}
}
catch (Exception e)
{
Debug.LogError(e.Message + " " + arg0);
}
}
}