using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ShouBingMuLu : MonoBehaviour
{
public GameObject MuLu;
public GameObject MuLu02;
public float time = 0;
private bool SJ = true;
// Use this for initialization
void Start()
{
if (MuLu != null)
{
MuLu.SetActive(false);
}
if (MuLu02 != null)
{
MuLu02.SetActive(false);
}
}
// Update is called once per frame
void Update()
{
if (this.gameObject.GetComponent<ShouBingKongZhiQi>().CeJianTaiQi == true)
{
SJ = true;
}
if (this.gameObject.GetComponent<ShouBingKongZhiQi>().CeJianAnZhu == true)
{
if (SJ == true)
{
time += Time.deltaTime;
}
}
if (time < 1 && 0 < time)
{
if (MuLu != null && MuLu02 != null)
{
if (MuLu.activeSelf == false && MuLu02.activeSelf == false)
{
if (this.gameObject.GetComponent<ShouBingKongZhiQi>().CeJianTaiQi == true)
{
if (MuLu != null)
{
MuLu.SetActive(true);
//重置时间
time = 0;
SJ = false;
}
}
}
else
{
if (this.gameObject.GetComponent<ShouBingKongZhiQi>().CeJianTaiQi == true)
{
MuLu.SetActive(false);
MuLu02.SetActive(false);
//重置时间
time = 0;
SJ = false;
}
}
}
}
if (time >= 1)
{
if (MuLu02 != null)
{
if (MuLu02.activeSelf == false)
{
if (MuLu.activeSelf == false)
{
MuLu02.SetActive(true);
this.gameObject.GetComponent<ShouBingKongZhiQi>().CeJianAnXia = false;
//重置时间
time = 0;
SJ = false;
}
else
{
MuLu.SetActive(false);
MuLu02.SetActive(true);
this.gameObject.GetComponent<ShouBingKongZhiQi>().CeJianAnXia = false;
//重置时间
time = 0;
SJ = false;
}
}
else
{
time = 0;
}
}
}
}
}