- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
85 lines
2.3 KiB
C#
85 lines
2.3 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
public class WeatherTest : MonoBehaviour
|
|
{
|
|
public string weatherName;
|
|
UnityAction weatherInitOver;
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
EnviroSkyMgr.instance.OnWeatherChanged += Instance_OnWeatherChanged;
|
|
}
|
|
|
|
private void Instance_OnWeatherChanged(EnviroWeatherPreset weatherType)
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
if (Input.GetKeyDown(KeyCode.Space))
|
|
{
|
|
InitWeather();
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.S))
|
|
{
|
|
EnviroSkyMgr.instance.enviroHDInstance.Stop();
|
|
}
|
|
//if (EnviroSkyMgr.instance.IsStarted())
|
|
//{
|
|
// Debug.Log(EnviroSkyMgr.instance.Weather.weatherPresets.Count);
|
|
//}
|
|
}
|
|
|
|
private void InitWeather()
|
|
{
|
|
|
|
GameObject dirLight = GameObject.Find("Directional Light");
|
|
if (dirLight)
|
|
GameObject.Destroy(dirLight);//删除原有的 方向光源
|
|
//EnviroSkyMgr.instance.Weather.startWeatherPreset = EnviroSkyMgr.instance.Weather.weatherPresets[weatherIndex];
|
|
EnviroSkyMgr.instance.AssignAndStart(Camera.main.gameObject, Camera.main);
|
|
EnviroSkyMgr.instance.enviroHDInstance.Play(EnviroTime.TimeProgressMode.None);
|
|
EnviroSkyMgr.instance.useVolumeLighting = false;
|
|
|
|
Debug.Log(weatherName);
|
|
StartCoroutine(ChangeWeather());
|
|
}
|
|
|
|
IEnumerator ChangeWeather()
|
|
{
|
|
yield return new WaitForEndOfFrame();
|
|
Debug.Log("aa");
|
|
if (EnviroSkyMgr.instance.Weather.weatherPresets.Count != 0)
|
|
{
|
|
int weatherIndex = 0;
|
|
switch (weatherName)
|
|
{
|
|
case "晴":
|
|
|
|
break;
|
|
case "雨":
|
|
weatherIndex = 3;
|
|
break;
|
|
case "雪":
|
|
weatherIndex = 4;
|
|
break;
|
|
case "雷雨":
|
|
weatherIndex = 5;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
EnviroSkyMgr.instance.ChangeWeatherInstant(weatherIndex);
|
|
}
|
|
//else
|
|
// StartCoroutine(ChangeWeather());
|
|
}
|
|
|
|
}
|