- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
105 lines
2.7 KiB
C#
105 lines
2.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using DevelopEngine;
|
|
|
|
public class MyEnviroManager : MonoSingleton<MyEnviroManager>
|
|
{
|
|
|
|
bool started;//天气系统是否已经启用
|
|
string weatherName;
|
|
|
|
///// <summary>
|
|
///// 给天气系统绑定目标
|
|
///// </summary>
|
|
///// <param name="player"></param>
|
|
///// <param name="camera"></param>
|
|
//public void AssignAndStart(GameObject player, Camera camera)
|
|
//{
|
|
// EnviroSkyMgr.instance.AssignAndStart(player, camera);
|
|
//}
|
|
|
|
/// <summary>
|
|
/// 绑定/切换 天气渲染目标
|
|
/// </summary>
|
|
/// <param name="player"></param>
|
|
/// <param name="camera"></param>
|
|
public void ChangeFocus(GameObject player, Camera camera)
|
|
{
|
|
EnviroSkyMgr.instance.ChangeFocus(player,camera);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 设置目标天气
|
|
/// 场景更换时注意先为天气系统绑定目标
|
|
/// </summary>
|
|
/// <param name="weatherName">天气名称</param>
|
|
public void SetWeather(string weatherName)
|
|
{
|
|
this.weatherName = weatherName;
|
|
if (!started)
|
|
{
|
|
InitWeatherAndPlay();
|
|
}
|
|
else
|
|
{
|
|
UpdateWeather();
|
|
}
|
|
}
|
|
|
|
//初始化天气效果 并启用
|
|
private void InitWeatherAndPlay()
|
|
{
|
|
GameObject dirLight = GameObject.Find("Directional Light");
|
|
if (dirLight)
|
|
GameObject.Destroy(dirLight);//删除原有的 方向光源 避免干扰
|
|
EnviroSkyMgr.instance.enviroHDInstance.Play(EnviroTime.TimeProgressMode.None);
|
|
EnviroSkyMgr.instance.useVolumeLighting = false;//关闭体积光
|
|
StartCoroutine(WaitWeatherInit());
|
|
}
|
|
|
|
/// <summary>
|
|
/// 结束天气系统
|
|
/// </summary>
|
|
public void Stop()
|
|
{
|
|
EnviroSkyMgr.instance.enviroHDInstance.Stop();//场景结束时 关闭天气系统
|
|
}
|
|
|
|
//循环检测 直到天气系统初始化完毕
|
|
IEnumerator WaitWeatherInit()
|
|
{
|
|
yield return new WaitForEndOfFrame();
|
|
if (EnviroSkyMgr.instance.Weather.weatherPresets.Count != 0)
|
|
UpdateWeather();
|
|
else
|
|
StartCoroutine(WaitWeatherInit());
|
|
}
|
|
|
|
private void UpdateWeather()
|
|
{
|
|
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);
|
|
}
|
|
|
|
|
|
|
|
}
|