55 lines
2.0 KiB
C#
55 lines
2.0 KiB
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class MultimeterRecovery : MonoBehaviour
|
|
{
|
|
Button btn;
|
|
[SerializeField] Transform RedTrans;
|
|
[SerializeField] Transform BlackTrans;
|
|
[SerializeField] Transform trans;
|
|
[SerializeField] Vector3 Redpos;
|
|
[SerializeField] Vector3 Blackpos;
|
|
public float Multimeter;
|
|
public string MultimeterV;
|
|
public bool redok;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
btn = GetComponent<Button>();
|
|
btn.onClick.AddListener(() =>
|
|
{
|
|
//GameManager.Instance.DianFuIm.gameObject.SetActive(true);
|
|
//GameManager.Instance.DianFuTex.text = Multimeter + MultimeterV;
|
|
trans = GameManager.Instance.temp.transform;
|
|
if (GameManager.Instance.RedWanYon)
|
|
{
|
|
RedTrans = GameManager.Instance.RedWanYon.transform;
|
|
RedTrans.parent = trans;
|
|
|
|
RedTrans.transform.DOLocalRotate(new Vector3(0, 0, 0), 0.25f);
|
|
RedTrans.transform.DOScale(new Vector3(1, 1, 1), 0.25f);
|
|
RedTrans.transform.DOLocalMove(Redpos, 0.25f);
|
|
RedTrans.gameObject.layer = 7;
|
|
}
|
|
if (GameManager.Instance.BlackWanYon)
|
|
{
|
|
BlackTrans = GameManager.Instance.BlackWanYon.transform;
|
|
BlackTrans.parent = trans;
|
|
BlackTrans.transform.DOLocalRotate(new Vector3(0, 0, 0), 0.25f);
|
|
BlackTrans.transform.DOScale(new Vector3(1, 1, 1), 0.25f);
|
|
BlackTrans.transform.DOLocalMove(Blackpos, 0.25f);
|
|
BlackTrans.gameObject.layer = 7;
|
|
}
|
|
GameManager.Instance.redok = false;
|
|
GameManager.Instance.redData = "0";
|
|
GameManager.Instance.show("0");
|
|
UIManager.Instance.toolsItemManager.recoverBtn.gameObject.SetActive(true);
|
|
});
|
|
btn.gameObject.SetActive(false);
|
|
}
|
|
}
|