H_SafeExperienceDrivingSystem/U3D_DrivingSystem/Assets/Script/WeatherManager.cs

33 lines
845 B
C#

using System.Collections;
using System.Collections.Generic;
using Script;
using UnityEngine;
public class WeatherManager : MonoBehaviour
{
public GameObject ysq;
public GameObject carglass;
public GameObject weather_rain;//雨
public GameObject weather_fog;//雾
public GameObject weather_snow;//雪
void Start()
{
switch ( GameInfo.instance.carSelectTypeInfo[CarType.])
{
case "雨天":
carglass.SetActive(true);
ysq.GetComponent<Animation>().Play();
weather_rain.SetActive(true);
break;
case "雪天":
weather_snow.SetActive(true);
break;
case "雾天":
weather_fog.SetActive(true);
break;
}
}
}