75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
using HighlightPlus;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Tool_InsulatedConductor : Tool_Base
|
|
{
|
|
/// <summary>
|
|
/// 预制体
|
|
/// </summary>
|
|
public static GameObject uiPrefbs;
|
|
|
|
public GameObject 红导线;
|
|
public GameObject 绿导线;
|
|
public GameObject 黄导线;
|
|
public GameObject 黑导线;
|
|
|
|
/// <summary>
|
|
/// 当前选中的导线
|
|
/// </summary>
|
|
public GameObject currentChoseLine;
|
|
/// <summary>
|
|
/// ui
|
|
/// </summary>
|
|
private InsulatedConductorPanel insulatedConductorPanel;
|
|
|
|
|
|
/// <summary>
|
|
/// 盒子中状态
|
|
/// </summary>
|
|
public void SetBoxState()
|
|
{
|
|
//transform.Find("盒子").gameObject.SetActive(true);
|
|
//红导线.transform.localPosition = new Vector3(0.002249179f, 0.0254f, -0.08313887f);
|
|
//红导线.transform.localEulerAngles = Vector3.zero;
|
|
//绿导线.transform.localPosition = new Vector3(-0.004413905f, 0.07645171f, -0.08313887f);
|
|
//绿导线.transform.localEulerAngles = Vector3.zero;
|
|
//黄导线.transform.localPosition = new Vector3(0.004091827f, 0.02574606f, 0.07529999f);
|
|
//黄导线.transform.localEulerAngles = Vector3.zero;
|
|
//黑导线.transform.localPosition = new Vector3(-0.007f, 0.07715699f, 0.07529999f);
|
|
//黑导线.transform.localEulerAngles = Vector3.zero;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 拿出状态
|
|
/// </summary>
|
|
public void SetChoeseState(string hightLightColor="")
|
|
{
|
|
//显示UI
|
|
if (uiPrefbs == null)
|
|
uiPrefbs = Resources.Load<GameObject>("UI/UI_Tip/InsulatedConductorPanel");
|
|
|
|
GameObject obj = Instantiate<GameObject>(uiPrefbs, GameManager.UIMgr.canvas.transform);
|
|
insulatedConductorPanel = obj.GetComponent<InsulatedConductorPanel>();
|
|
insulatedConductorPanel.Init(this);
|
|
|
|
if (!string.IsNullOrEmpty(hightLightColor))
|
|
{
|
|
insulatedConductorPanel.SwitchSubProcessStepTriggerID("选择"+hightLightColor+"线");
|
|
}
|
|
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
protected override void OnDestroy()
|
|
{
|
|
base.OnDestroy();
|
|
if (insulatedConductorPanel != null)
|
|
{
|
|
Destroy(insulatedConductorPanel.gameObject);
|
|
}
|
|
}
|
|
}
|