天津23维预案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

95 lines
4.3 KiB

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using AX.MessageSystem;
using AX.TrackRecord;
public class ConfirmResetExplode : MonoBehaviour {
public GameObject youGuanParent;
public Vector3 pos = Vector3.zero;
public Quaternion rotation;
// Use this for initialization
void Start () {
GetComponent<Button>().onClick.AddListener(Confirm);
}
// Update is called once per frame
void Update () {
}
void Confirm()
{
pos = youGuanParent.GetComponent<RESET_OILTANKDISASTER_ATRRI>().pos;
rotation = youGuanParent.GetComponent<RESET_OILTANKDISASTER_ATRRI>().rotation;
youGuanParent.transform.Find("Canvas1").Find("Slider").GetComponent<Slider>().value = 0;
youGuanParent.transform.Find("Canvas1").Find("Slider").GetComponentInChildren<OilTankDisasterControl>().StopTrigger();
youGuanParent.transform.Find("Canvas1").Find("Slider").GetComponent<OilTankDisasterControl>().happening = false;
youGuanParent.transform.Find("Canvas1").Find("Slider").GetComponent<OilTankDisasterControl>().flag = false;
youGuanParent.transform.Find("Canvas1").Find("Slider").GetComponent<OilTankDisasterControl>().flag1 = false;
if (youGuanParent.name == "QiuXingGuan")
{
youGuanParent.transform.GetChild(0).gameObject.SetActive(true);
youGuanParent.transform.GetChild(0).Find("XF_QGGT_0").GetComponent<Renderer>().material.SetColor("_EmissionColor",
new Color(0f, 0f, 0f));
youGuanParent.transform.Find("QG_Twist").gameObject.SetActive(false);
youGuanParent.transform.Find("QG_Exp").gameObject.SetActive(false);
youGuanParent.transform.Find("QG_Exp").Find("QG_G").position = pos;
youGuanParent.transform.Find("QG_Exp").Find("QG_G").localRotation = rotation;
}
if (youGuanParent.name == "FuDingGuan")
{
youGuanParent.transform.GetChild(0).gameObject.SetActive(true);
youGuanParent.transform.GetChild(0).Find("XF_WFDGT_0").GetComponent<Renderer>().material.SetColor("_EmissionColor",
new Color(0f, 0f, 0f));
youGuanParent.transform.Find("WFDG_Twist").gameObject.SetActive(false);
youGuanParent.transform.Find("WFDG_Exp").gameObject.SetActive(false);
youGuanParent.transform.Find("WFDG_Exp").Find("XF_WFDG_0").position = pos;
youGuanParent.transform.Find("WFDG_Exp").Find("XF_WFDG_0").localRotation = rotation;
}
if (youGuanParent.name == "GongDingG")
{
youGuanParent.transform.GetChild(0).gameObject.SetActive(true);
youGuanParent.transform.GetChild(0).Find("guanbi").GetComponent<Renderer>().material.SetColor("_EmissionColor",
new Color(0f, 0f, 0f));
youGuanParent.transform.GetChild(0).Find("guanding").GetComponent<Renderer>().material.SetColor("_EmissionColor",
new Color(0f, 0f, 0f));
youGuanParent.transform.Find("GDG_Twist").gameObject.SetActive(false);
youGuanParent.transform.Find("GDG_Exp").gameObject.SetActive(false);
youGuanParent.transform.Find("GDG_Exp").Find("GongDingGuanGaiZi_Explode").position = pos;
youGuanParent.transform.Find("GDG_Exp").Find("GongDingGuanGaiZi_Explode").localRotation = rotation;
}
//1.没按F5来触发过爆炸或变形前修改的情况下,重置需要删除设置时随机产生的火
//2.如已按F5触发过爆炸或变形后再修改的情况,重置需要删除设置时随机产生的火后爆炸(变形后)随机产生的火
Transform pfire = GameObject.Find("pfire").transform;
foreach (Transform child in pfire)
{
if (child.GetComponent<ExplodeFire>() && child.GetComponent<ExplodeFire>().youGuan == youGuanParent.transform.GetChild(0).gameObject)
{
Destroy(child.gameObject);
}
}
youGuanParent.transform.GetChild(0).gameObject.GetComponent<ShowOilTankDisasterSetWin>().oilTank = new OilTank();
this.transform.parent.gameObject.SetActive(false);
if (RecordManager.Instance.IsRecording)
{
MessageDispatcher.SendMessage("RecordResetOilTankEvent", (object)youGuanParent.transform.GetChild(0).name);
}
}
}