unityzgy/.svn/pristine/7f/7f0da1ad4b68fa3fe4221ab43a7539560197219c.svn-base
ayuan9957 bf12e02276 feat: 多语言本地化系统 - 支持中/英/法/俄实时切换
- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg)
- LoginPanel: InputField placeholder本地化、字体颜色保持
- HistoryPanel: 用时数据本地化、placeholder本地化
- RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建)
- AppraiseWindowBase: 评价等级本地化、操作消息重建
- EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized
- StudentOperateRecorder: 新增InjectOperateMsgLocalized方法
- LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选
- 字体切换时保留颜色和verticalOverflow
2026-07-16 10:05:59 +08:00

150 lines
4.9 KiB
Plaintext

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEditorInternal;
[CustomEditor(typeof(EnviroReflectionProbe))]
public class EnviroReflectionProbeEditor : Editor {
GUIStyle boxStyle;
GUIStyle boxStyleModified;
GUIStyle wrapStyle;
GUIStyle wrapStyle2;
GUIStyle clearStyle;
EnviroReflectionProbe myTarget;
public bool showAudio = false;
public bool showFog = false;
public bool showSeason = false;
public bool showClouds = false;
public bool showGeneral = false;
public bool showPostProcessing = false;
public bool showThirdParty = false;
private Color boxColor1;
SerializedObject serializedObj;
#if ENVIRO_HD
SerializedProperty customCloudsQuality;
#endif
void OnEnable()
{
myTarget = (EnviroReflectionProbe)target;
serializedObj = new SerializedObject (myTarget);
#if ENVIRO_HD
customCloudsQuality = serializedObj.FindProperty("customCloudsQuality");
#endif
#if UNITY_2019_3_OR_NEWER
boxColor1 = new Color(0.95f, 0.95f, 0.95f,1f);
#else
boxColor1 = new Color(0.85f, 0.85f, 0.85f, 1f);
#endif
}
public override void OnInspectorGUI ()
{
myTarget = (EnviroReflectionProbe)target;
serializedObj.UpdateIfRequiredOrScript ();
//Set up the box style
if (boxStyle == null)
{
boxStyle = new GUIStyle(GUI.skin.box);
boxStyle.normal.textColor = GUI.skin.label.normal.textColor;
boxStyle.fontStyle = FontStyle.Bold;
boxStyle.alignment = TextAnchor.UpperLeft;
}
if (boxStyleModified == null)
{
boxStyleModified = new GUIStyle(EditorStyles.helpBox);
boxStyleModified.normal.textColor = GUI.skin.label.normal.textColor;
boxStyleModified.fontStyle = FontStyle.Bold;
boxStyleModified.fontSize = 11;
boxStyleModified.alignment = TextAnchor.UpperLeft;
}
//Setup the wrap style
if (wrapStyle == null)
{
wrapStyle = new GUIStyle(GUI.skin.label);
wrapStyle.fontStyle = FontStyle.Bold;
wrapStyle.wordWrap = true;
}
if (wrapStyle2 == null)
{
wrapStyle2 = new GUIStyle(GUI.skin.label);
wrapStyle2.fontStyle = FontStyle.Normal;
wrapStyle2.wordWrap = true;
}
if (clearStyle == null) {
clearStyle = new GUIStyle(GUI.skin.label);
clearStyle.normal.textColor = GUI.skin.label.normal.textColor;
clearStyle.fontStyle = FontStyle.Bold;
clearStyle.alignment = TextAnchor.UpperRight;
}
GUILayout.BeginVertical(" Enviro - Reflection Probe", boxStyle);
GUILayout.Space(30);
GUI.backgroundColor = boxColor1;
GUILayout.BeginVertical("Information", boxStyleModified);
GUI.backgroundColor = Color.white;
GUILayout.Space(20);
EditorGUILayout.LabelField("Use this component to update your realtime reflection probes with Enviro Sky. You also can enable the 'Custom Rendering' to have enviro effects in your reflection probes!", wrapStyle2);
EditorGUILayout.LabelField("Please enable 'Standalone Probe' if you use this component on your own places reflection probes.", wrapStyle2);
GUILayout.EndVertical();
GUI.backgroundColor = boxColor1;
GUILayout.BeginVertical("Setup", boxStyleModified);
GUI.backgroundColor = Color.white;
GUILayout.Space(20);
myTarget.standalone = EditorGUILayout.Toggle("Standalone Probe", myTarget.standalone);
if (myTarget.standalone)
{
GUILayout.Space(10);
#if ENVIRO_HD
GUI.backgroundColor = boxColor1;
GUILayout.BeginVertical("Enviro Effects Rendering", boxStyleModified);
GUI.backgroundColor = Color.white;
GUILayout.Space(20);
myTarget.customRendering = EditorGUILayout.Toggle("Render Enviro Effects", myTarget.customRendering);
if(myTarget.customRendering)
{
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(customCloudsQuality, true, null);
myTarget.useFog = EditorGUILayout.Toggle("Use Fog", myTarget.useFog);
if (EditorGUI.EndChangeCheck())
{
serializedObj.ApplyModifiedProperties();
}
}
GUILayout.EndVertical();
#endif
GUI.backgroundColor = boxColor1;
GUILayout.BeginVertical("Update Settings", boxStyleModified);
GUI.backgroundColor = Color.white;
GUILayout.Space(20);
myTarget.reflectionsUpdateTreshhold = EditorGUILayout.FloatField("Update Treshold in GameTime Hours", myTarget.reflectionsUpdateTreshhold);
if (myTarget.customRendering)
{
myTarget.useTimeSlicing = EditorGUILayout.Toggle("Use Time-Slicing", myTarget.useTimeSlicing);
}
GUILayout.EndVertical();
}
GUILayout.EndVertical();
// END
EditorGUILayout.EndVertical ();
EditorUtility.SetDirty (target);
}
}