76 lines
2.9 KiB
C#
76 lines
2.9 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 void Init()
|
|
{
|
|
activation = ClampAmmetersManager.Instance.Init(name);
|
|
}
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
if (GameManager.Instance.BlackWanYon != null && isBlack)
|
|
{
|
|
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;
|
|
GameManager.Instance.MultimeterIm.gameObject.SetActive(true);
|
|
UIManager.Instance.toolsItemManager.recoverBtn.gameObject.SetActive(false);
|
|
GameManager.Instance.redok = true;
|
|
if (GameManager.Instance.redok)
|
|
{
|
|
if (GameManager.Instance.WanStopValve.currentValue >= 2)
|
|
{
|
|
GameManager.Instance.DianFuIm.gameObject.SetActive(true);
|
|
GameManager.Instance.MultimeterIm.gameObject.SetActive(true);
|
|
GameManager.Instance.show(GameManager.Instance.redData + VV);
|
|
}
|
|
else
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|
|
if (GameManager.Instance.RedWanYon != null && !isBlack)
|
|
{
|
|
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);
|
|
if (GameManager.Instance.redok)
|
|
{
|
|
if (GameManager.Instance.WanStopValve.currentValue >= 2)
|
|
{
|
|
GameManager.Instance.DianFuIm.gameObject.SetActive(true);
|
|
GameManager.Instance.DianFuTex.text = activation;
|
|
|
|
GameManager.Instance.MultimeterIm.gameObject.SetActive(true);
|
|
GameManager.Instance.show(activation + VV);
|
|
}
|
|
else
|
|
{
|
|
|
|
}
|
|
}
|
|
GameManager.Instance.redData = activation;
|
|
}
|
|
}
|
|
}
|