86 lines
3.4 KiB
C#
86 lines
3.4 KiB
C#
using DG.Tweening;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Multimeter : MonoBehaviour
|
|
{
|
|
[Header("是否带电")]
|
|
public bool electricity = false;
|
|
[Header("电流")]
|
|
public string activation;
|
|
public string name;
|
|
public bool isBlack;
|
|
public string VV;
|
|
public bool isok = false;
|
|
public GameObject huishouBtn;
|
|
|
|
public void Init()
|
|
{
|
|
activation = ClampAmmetersManager.Instance.Init(name);
|
|
huishouBtn = GameManager.Instance.MultimeterIm.gameObject;
|
|
huishouBtn.SetActive(false);
|
|
}
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
if (GameManager.Instance.BlackWanYon != null && isBlack)
|
|
{
|
|
huishouBtn.SetActive(true);
|
|
GameManager.Instance.BlackWanYon.transform.parent = transform;
|
|
GameManager.Instance.BlackWanYon.transform.DOLocalRotate(new Vector3(56, 0, 0), 0.25f);
|
|
GameManager.Instance.BlackWanYon.transform.DOScale(new Vector3(200, 200, 200), 0.25f);
|
|
GameManager.Instance.BlackWanYon.transform.DOLocalMove(new Vector3(-0.14f, -0.08f, 0.11f), 0.25f);
|
|
GameManager.Instance.BlackWanYon.layer = 0;
|
|
UIManager.Instance.toolsItemManager.recoverBtn.gameObject.SetActive(false);
|
|
GameManager.Instance.redok = true;
|
|
GameManager.Instance.DianFuIm.gameObject.SetActive(true);
|
|
if (GameManager.Instance.redok)
|
|
{
|
|
if (GameManager.Instance.WanStopValve.currentValue >= 2)
|
|
{
|
|
huishouBtn.SetActive(true);
|
|
GameManager.Instance.show(GameManager.Instance.redData + VV);
|
|
FractionManager.Instance.CheckWanYong(true);
|
|
Debug.Log("有开启万用表");
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("没有开启万用表");
|
|
FractionManager.Instance.CheckWanYong(false);
|
|
}
|
|
}
|
|
}
|
|
if (GameManager.Instance.RedWanYon != null && !isBlack)
|
|
{
|
|
huishouBtn.SetActive(true);
|
|
GameManager.Instance.RedWanYon.transform.parent = transform;
|
|
GameManager.Instance.RedWanYon.transform.DOLocalRotate(new Vector3(56, 0, 0), 0.25f);
|
|
GameManager.Instance.RedWanYon.transform.DOScale(new Vector3(200, 200, 200), 0.25f);
|
|
GameManager.Instance.RedWanYon.transform.DOLocalMove(new Vector3(-0.08f, 0.08f, 0.11f), 0.25f);
|
|
GameManager.Instance.RedWanYon.layer = 0;
|
|
UIManager.Instance.toolsItemManager.recoverBtn.gameObject.SetActive(false);
|
|
GameManager.Instance.DianFuIm.gameObject.SetActive(true);
|
|
if (GameManager.Instance.redok)
|
|
{
|
|
if (GameManager.Instance.WanStopValve.currentValue >= 2)
|
|
{
|
|
GameManager.Instance.DianFuTex.text = activation;
|
|
|
|
huishouBtn.SetActive(true);
|
|
GameManager.Instance.show(activation + VV);
|
|
FractionManager.Instance.CheckWanYong(true);
|
|
Debug.Log("有开启万用表");
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("没有开启万用表");
|
|
FractionManager.Instance.CheckWanYong(false);
|
|
}
|
|
}
|
|
GameManager.Instance.redData = activation;
|
|
}
|
|
}
|
|
}
|