- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class EnviroLightning : MonoBehaviour {
|
|
|
|
public void Lightning()
|
|
{
|
|
StartCoroutine(LightningBolt());
|
|
}
|
|
|
|
public void StopLightning()
|
|
{
|
|
StopAllCoroutines ();
|
|
GetComponent<Light> ().enabled = false;
|
|
EnviroSkyMgr.instance.SetLightningFlashTrigger(0f);
|
|
}
|
|
|
|
|
|
public IEnumerator LightningBolt()
|
|
{
|
|
GetComponent<Light> ().enabled = true;
|
|
//record the starting/off intensity of the light
|
|
float defaultIntensity = GetComponent<Light>().intensity;
|
|
//number of flashes this bolt will display
|
|
int flashCount = Random.Range(2, 5);
|
|
int thisFlash = 0;
|
|
|
|
while(thisFlash < flashCount){
|
|
GetComponent<Light>().intensity = defaultIntensity * Random.Range(1, 1.5f);
|
|
EnviroSkyMgr.instance.SetLightningFlashTrigger(Random.Range (5f, 10f));
|
|
yield return new WaitForSeconds(Random.Range (0.05f,0.1f));
|
|
GetComponent<Light>().intensity = defaultIntensity;
|
|
EnviroSkyMgr.instance.SetLightningFlashTrigger(1f);
|
|
thisFlash++;
|
|
}
|
|
|
|
GetComponent<Light> ().enabled = false;
|
|
}
|
|
|
|
}
|