47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			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;//雪
 | |
|     public GameObject weather_clear;//晴
 | |
| 
 | |
| 
 | |
|     public GameObject xuetianglass;
 | |
|     public GameObject 地面;
 | |
|     public Material snowMaterial;
 | |
|     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);
 | |
|                 xuetianglass.SetActive(true);
 | |
|                 
 | |
|                 weather_snow.transform.Find("下雪01").GetComponent<ParticleSystem>().Play();
 | |
|                 
 | |
|                 // 地面.transform.GetComponent<MeshRenderer>().material = snowMaterial;
 | |
|                 break;
 | |
|             case "雾天":
 | |
|                
 | |
|                 weather_fog.SetActive(true);
 | |
|                 break;
 | |
|             case "晴天":
 | |
|                 weather_clear.SetActive(true);
 | |
|                 break;
 | |
|         }
 | |
|     }
 | |
| 
 | |
| }
 |