57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class pARK : MonoBehaviour
|
|
{
|
|
public GameObject NextScene;
|
|
public GameObject luzhang1;
|
|
public GameObject luzhang2;
|
|
public GameObject luzhang3;
|
|
public GameObject car;
|
|
|
|
public GameObject speed1;
|
|
public GameObject speed2;
|
|
|
|
// Start is called before the first frame update
|
|
//private void Start()
|
|
//{
|
|
// print("DIAOYONGXIECEHNG");
|
|
// StartCoroutine(Fun());
|
|
//}
|
|
//IEnumerator Fun()
|
|
//{
|
|
// yield return new WaitForSeconds(4.5f);
|
|
// {
|
|
// print("跳转了下一场景");
|
|
// NextScene.SetActive(true);
|
|
// }
|
|
//}
|
|
|
|
private void OnEnable()
|
|
{
|
|
print("调用携程");
|
|
StartCoroutine(Fun());
|
|
}
|
|
|
|
|
|
IEnumerator Fun()
|
|
{
|
|
yield return new WaitForSeconds(2f);
|
|
{
|
|
|
|
car.GetComponent<Animator>().enabled = false;
|
|
car.GetComponent<UnityStandardAssets.Vehicles.Car.CarUserControl>().enabled = true;
|
|
car.GetComponent<Rigidbody>().isKinematic = false;
|
|
//car.GetComponent<UnityStandardAssets.Vehicles.Car.CarController>().enabled = true;
|
|
print("car可以操控了");
|
|
luzhang1.SetActive(false);
|
|
luzhang2.SetActive(true);
|
|
luzhang3.SetActive(false);
|
|
///速度表盘归零问题
|
|
speed1.SetActive(true);
|
|
speed2.SetActive(false);
|
|
}
|
|
}
|
|
}
|