82 lines
3.1 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|