unityzgy/.svn/pristine/4c/4ca7151d5e6e1419187a72bd72d784e3185e8e21.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

100 lines
4.1 KiB
Plaintext

using System;
using UnityEditor;
using UnityEngine;
namespace UnityStandardAssets.ImageEffects
{
[CustomEditor (typeof(CameraMotionBlur))]
class CameraMotionBlurEditor : Editor
{
SerializedObject serObj;
SerializedProperty filterType;
SerializedProperty preview;
SerializedProperty previewScale;
SerializedProperty movementScale;
SerializedProperty jitter;
SerializedProperty rotationScale;
SerializedProperty maxVelocity;
SerializedProperty minVelocity;
SerializedProperty velocityScale;
SerializedProperty velocityDownsample;
SerializedProperty noiseTexture;
SerializedProperty showVelocity;
SerializedProperty showVelocityScale;
SerializedProperty excludeLayers;
void OnEnable () {
serObj = new SerializedObject (target);
filterType = serObj.FindProperty ("filterType");
preview = serObj.FindProperty ("preview");
previewScale = serObj.FindProperty ("previewScale");
movementScale = serObj.FindProperty ("movementScale");
rotationScale = serObj.FindProperty ("rotationScale");
maxVelocity = serObj.FindProperty ("maxVelocity");
minVelocity = serObj.FindProperty ("minVelocity");
jitter = serObj.FindProperty ("jitter");
excludeLayers = serObj.FindProperty ("excludeLayers");
velocityScale = serObj.FindProperty ("velocityScale");
velocityDownsample = serObj.FindProperty ("velocityDownsample");
noiseTexture = serObj.FindProperty ("noiseTexture");
}
public override void OnInspectorGUI () {
serObj.Update ();
EditorGUILayout.LabelField("Simulates camera based motion blur", EditorStyles.miniLabel);
EditorGUILayout.PropertyField (filterType, new GUIContent("Technique"));
if (filterType.enumValueIndex == 3 && !(target as CameraMotionBlur).Dx11Support()) {
EditorGUILayout.HelpBox("DX11 mode not supported (need shader model 5)", MessageType.Info);
}
EditorGUILayout.PropertyField (velocityScale, new GUIContent(" Velocity Scale"));
if (filterType.enumValueIndex >= 2) {
EditorGUILayout.LabelField(" Tile size used during reconstruction filter:", EditorStyles.miniLabel);
EditorGUILayout.PropertyField (maxVelocity, new GUIContent(" Velocity Max"));
}
else
EditorGUILayout.PropertyField (maxVelocity, new GUIContent(" Velocity Max"));
EditorGUILayout.PropertyField (minVelocity, new GUIContent(" Velocity Min"));
EditorGUILayout.Separator ();
EditorGUILayout.LabelField("Technique Specific");
if (filterType.enumValueIndex == 0) {
// portal style motion blur
EditorGUILayout.PropertyField (rotationScale, new GUIContent(" Camera Rotation"));
EditorGUILayout.PropertyField (movementScale, new GUIContent(" Camera Movement"));
}
else {
// "plausible" blur or cheap, local blur
EditorGUILayout.PropertyField (excludeLayers, new GUIContent(" Exclude Layers"));
EditorGUILayout.PropertyField (velocityDownsample, new GUIContent(" Velocity Downsample"));
velocityDownsample.intValue = velocityDownsample.intValue < 1 ? 1 : velocityDownsample.intValue;
if (filterType.enumValueIndex >= 2) { // only display jitter for reconstruction
EditorGUILayout.PropertyField (noiseTexture, new GUIContent(" Sample Jitter"));
EditorGUILayout.PropertyField (jitter, new GUIContent(" Jitter Strength"));
}
}
EditorGUILayout.Separator ();
EditorGUILayout.PropertyField (preview, new GUIContent("Preview"));
if (preview.boolValue)
EditorGUILayout.PropertyField (previewScale, new GUIContent(""));
serObj.ApplyModifiedProperties();
}
}
}