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.
106 lines
2.4 KiB
106 lines
2.4 KiB
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SuiDaoManager : MonoBehaviour
|
|
{
|
|
public GameObject huozai;
|
|
public GameObject huozaiTipWnd;
|
|
public GameObject TingCheTip;
|
|
public GameObject BianDaoTip;
|
|
public Button ChuLiTingCheBtn;
|
|
public Button BianDaoChuLiBtn;
|
|
public GameObject TingCheChuliWnd;
|
|
public GameObject BianDaoChuliWnd;
|
|
public Transform biandaoPoint;
|
|
public Transform tingchePoint;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public void FireActionStart()
|
|
{
|
|
StartCoroutine(TimeAction(UnityEngine.Random.Range(20,40), () => {
|
|
huozai.SetActive(true);
|
|
huozaiTipWnd.SetActive(true);
|
|
}));
|
|
}
|
|
|
|
IEnumerator TimeAction(float time,Action action)
|
|
{
|
|
yield return new WaitForSeconds(time);
|
|
action();
|
|
}
|
|
|
|
public void StartTingChe(GameObject car)
|
|
{
|
|
//窗口提示
|
|
GameManagerForZhuanWan.Instance.StartTimeAction(UnityEngine.Random.Range(10, 25), () => { TingCheTip.SetActive(true); });
|
|
|
|
ChuLiTingCheBtn.onClick.AddListener(() => {
|
|
|
|
//相机移动
|
|
GameManagerForZhuanWan.Instance.pass1Camera.MoveToPoint(biandaoPoint);
|
|
//车辆动画播放
|
|
car.SetActive(true);
|
|
//等待动画完成后进行处理选项
|
|
GameManagerForZhuanWan.Instance.StartTimeAction(1.5f, () => {
|
|
|
|
Time.timeScale = 0;
|
|
TingCheChuliWnd.SetActive(true);
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
public void StartBianDao(GameObject car)
|
|
{
|
|
//窗口提示
|
|
GameManagerForZhuanWan.Instance.StartTimeAction(UnityEngine.Random.Range(10, 25), () => { BianDaoTip.SetActive(true); });
|
|
|
|
BianDaoChuLiBtn.onClick.AddListener(() => {
|
|
|
|
//相机移动
|
|
GameManagerForZhuanWan.Instance.pass1Camera.MoveToPoint(biandaoPoint);
|
|
//车辆动画播放
|
|
car.SetActive(true);
|
|
//等待动画完成后进行处理选项
|
|
GameManagerForZhuanWan.Instance.StartTimeAction(1.5f, () => {
|
|
|
|
Time.timeScale = 0;
|
|
BianDaoChuliWnd.SetActive(true);
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public void SetTimeScale(float time)
|
|
{
|
|
Time.timeScale = time;
|
|
}
|
|
|
|
}
|