- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
77 lines
1.7 KiB
Plaintext
77 lines
1.7 KiB
Plaintext
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
[ExecuteInEditMode]
|
|
public class causticsProjector : MonoBehaviour {
|
|
|
|
public Texture2D[] images;
|
|
public float Delay;
|
|
public int curImage = 0;
|
|
float curTime = 0;
|
|
Projector p;
|
|
public bool setParameters = true;
|
|
public float CausticIntensity, HeightCut, UnderWaterCut, CausticsSize = 0.33f;
|
|
public bool UpdateProjector;
|
|
|
|
|
|
void Update () {
|
|
if (UpdateProjector) {
|
|
UpdateProjector =false;
|
|
p.material = null;
|
|
|
|
print("Projector updated !");
|
|
}
|
|
|
|
if (p)
|
|
{
|
|
if (p.material ==null )
|
|
{
|
|
Material instance = new Material(Shader.Find("DCG/Water Shader/Caustics"));
|
|
instance.name = "Caustics Material";
|
|
// instance.hideFlags = HideFlags.HideAndDontSave;
|
|
|
|
p.material = instance;
|
|
|
|
instance.SetTexture("_Caustic",images[0]);
|
|
|
|
instance.SetFloat("_CausticsScale",CausticsSize);
|
|
instance.SetFloat("_CausticIntensity",CausticIntensity);
|
|
instance.SetColor("_CausticColor",Color.white);
|
|
|
|
instance.SetFloat("_HeightCut",HeightCut);
|
|
instance.SetFloat("_UnderwaterCut",UnderWaterCut);
|
|
}
|
|
|
|
if (setParameters)
|
|
{
|
|
p.material .SetFloat("_HeightCut",HeightCut);
|
|
p.material .SetFloat("_UnderwaterCut",UnderWaterCut);
|
|
p.material .SetFloat("_CausticsScale",CausticsSize);
|
|
p.material .SetFloat("_CausticsIntensity",CausticIntensity);
|
|
}
|
|
|
|
curTime += Time.deltaTime;
|
|
|
|
|
|
if(curTime >=Delay)
|
|
{
|
|
curTime = 0;
|
|
p.material .SetTexture("_Caustic",images[curImage]);
|
|
if (curImage < (images.Length -1))
|
|
{
|
|
curImage+=1;
|
|
}
|
|
else
|
|
{
|
|
curImage = 0;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
p = GetComponent<Projector> ();
|
|
print("Projector Found !");
|
|
}
|
|
}
|
|
}
|