- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
using UnityEngine;
|
|
using System.Collections;
|
|
#if ENVIRO_MEGASPLAT_SUPPORT
|
|
[AddComponentMenu("Enviro/Integration/MegaSplat Integration")]
|
|
#endif
|
|
public class EnviroMegaSplatIntegration : MonoBehaviour {
|
|
#if ENVIRO_MEGASPLAT_SUPPORT
|
|
public MegaSplatTerrainManager MegaSplatTerrianMgr;
|
|
private Material MegaSplatMaterial;
|
|
|
|
[Header("Synchronize Weather")]
|
|
public bool UpdateWetness = true;
|
|
public bool UpdateSnow = true;
|
|
public bool UpdatePuddles = true;
|
|
public bool UpdateRainRipples = true;
|
|
|
|
[Header("Puddle Settings")]
|
|
[Range(0f,1f)]
|
|
public float puddleStartWetness = 0.25f;
|
|
|
|
private Vector4 MegaSplatWetness;
|
|
private float puddleBlend;
|
|
|
|
void Start ()
|
|
{
|
|
|
|
if (MegaSplatTerrianMgr == null)
|
|
MegaSplatTerrianMgr = GameObject.FindObjectOfType<MegaSplatTerrainManager>();
|
|
|
|
if (MegaSplatTerrianMgr != null)
|
|
MegaSplatMaterial = MegaSplatTerrianMgr.templateMaterial;
|
|
|
|
if (MegaSplatMaterial != null)
|
|
MegaSplatWetness = MegaSplatMaterial.GetVector ("_GlobalPorosityWetness");
|
|
}
|
|
|
|
void Update ()
|
|
{
|
|
if (MegaSplatTerrianMgr == null || MegaSplatMaterial == null || EnviroSkyMgr.instance == null)
|
|
return;
|
|
|
|
if (UpdateSnow){
|
|
MegaSplatMaterial.SetFloat ("_SnowAmount", EnviroSkyMgr.instance.GetSnowIntensity());
|
|
}
|
|
|
|
if (UpdateWetness) {
|
|
MegaSplatMaterial.SetVector ("_GlobalPorosityWetness", new Vector4(MegaSplatWetness.x,EnviroSkyMgr.instance.GetWetnessIntensity(),MegaSplatWetness.z,MegaSplatWetness.w));
|
|
}
|
|
|
|
if (UpdatePuddles) {
|
|
puddleBlend = Mathf.Clamp(EnviroSkyMgr.instance.GetWetnessIntensity() - puddleStartWetness, 0f,1f) * 60f;
|
|
puddleBlend = Mathf.Clamp (puddleBlend, 1f, 60f);
|
|
MegaSplatMaterial.SetFloat ("_PuddleBlend",puddleBlend);
|
|
}
|
|
|
|
if (UpdateRainRipples) {
|
|
MegaSplatMaterial.SetFloat("_RainIntensity", EnviroSkyMgr.instance.GetWetnessIntensity());
|
|
}
|
|
|
|
MegaSplatTerrianMgr.Sync();
|
|
|
|
}
|
|
#endif
|
|
}
|