- LocalizationManager: 新增翻译表(SetFormatted/SetDuration/LocalizeOperateMsg) - LoginPanel: InputField placeholder本地化、字体颜色保持 - HistoryPanel: 用时数据本地化、placeholder本地化 - RecordDetailPanel: 操作详情消息本地化(LanguageChanged重建) - AppraiseWindowBase: 评价等级本地化、操作消息重建 - EditorAppraiser: 所有评估消息改用InjectOperateMsgLocalized - StudentOperateRecorder: 新增InjectOperateMsgLocalized方法 - LocalizationLanguageTestBar: 单例模式、ScreenSpaceOverlay筛选 - 字体切换时保留颜色和verticalOverflow
101 lines
3.6 KiB
Plaintext
101 lines
3.6 KiB
Plaintext
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEditor;
|
|
#if WORLDAPI_PRESENT
|
|
[CustomEditor(typeof(EnviroWorldAPIIntegration))]
|
|
public class EnviroWAPIEditor : Editor {
|
|
|
|
private GUIStyle boxStyle;
|
|
private GUIStyle wrapStyle;
|
|
private GUIStyle headerStyle;
|
|
|
|
SerializedObject serializedObj;
|
|
private EnviroWorldAPIIntegration myTarget;
|
|
|
|
SerializedProperty snowPower, wetnessPower, fogPower, fogPowerMult, windDirection, windSpeed, seasons, time, cloudCover, location, temperature;
|
|
|
|
void OnEnable()
|
|
{
|
|
myTarget = (EnviroWorldAPIIntegration)target;
|
|
serializedObj = new SerializedObject (myTarget);
|
|
snowPower = serializedObj.FindProperty ("snowPower");
|
|
wetnessPower = serializedObj.FindProperty ("wetnessPower");
|
|
temperature = serializedObj.FindProperty("temperature");
|
|
fogPower = serializedObj.FindProperty ("fogPower");
|
|
fogPowerMult = serializedObj.FindProperty ("fogPowerMult");
|
|
windDirection = serializedObj.FindProperty ("windDirection");
|
|
windSpeed = serializedObj.FindProperty ("windSpeed");
|
|
seasons = serializedObj.FindProperty ("seasons");
|
|
time = serializedObj.FindProperty ("time");
|
|
cloudCover = serializedObj.FindProperty ("cloudCover");
|
|
location = serializedObj.FindProperty ("location");
|
|
}
|
|
|
|
|
|
public override void OnInspectorGUI ()
|
|
{
|
|
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 (wrapStyle == null)
|
|
{
|
|
wrapStyle = new GUIStyle(GUI.skin.label);
|
|
wrapStyle.fontStyle = FontStyle.Normal;
|
|
wrapStyle.wordWrap = true;
|
|
}
|
|
|
|
if (headerStyle == null)
|
|
{
|
|
headerStyle = new GUIStyle(GUI.skin.label);
|
|
headerStyle.fontStyle = FontStyle.Bold;
|
|
headerStyle.wordWrap = true;
|
|
}
|
|
|
|
EditorGUI.BeginChangeCheck ();
|
|
GUILayout.BeginVertical("Enviro - WAPI Integration", boxStyle);
|
|
GUILayout.Space(20);
|
|
EditorGUILayout.LabelField("Welcome to the World Manager Integration for Enviro - Sky and Weather!", wrapStyle);
|
|
GUILayout.EndVertical ();
|
|
GUILayout.BeginVertical("Controls", boxStyle);
|
|
GUILayout.Space(20);
|
|
GUILayout.BeginVertical("Time, Season and Location", boxStyle);
|
|
GUILayout.Space(20);
|
|
EditorGUILayout.PropertyField (time, true, null);
|
|
EditorGUILayout.PropertyField (location, true, null);
|
|
EditorGUILayout.PropertyField (seasons, true, null);
|
|
GUILayout.EndVertical ();
|
|
GUILayout.BeginVertical("Weather", boxStyle);
|
|
GUILayout.Space(20);
|
|
EditorGUILayout.LabelField("Enviro will change weather when using GetFromWAPI mode here to match WAPI values!", wrapStyle);
|
|
EditorGUI.indentLevel++;
|
|
EditorGUILayout.PropertyField (cloudCover, true, null);
|
|
EditorGUILayout.PropertyField (snowPower, true, null);
|
|
EditorGUILayout.PropertyField (wetnessPower, true, null);
|
|
EditorGUILayout.PropertyField (temperature, true, null);
|
|
EditorGUI.indentLevel--;
|
|
GUILayout.Space(10);
|
|
GUILayout.Label ("Wind",headerStyle);
|
|
EditorGUI.indentLevel++;
|
|
EditorGUILayout.PropertyField (windSpeed, true, null);
|
|
EditorGUILayout.PropertyField (windDirection, true, null);
|
|
EditorGUI.indentLevel--;
|
|
GUILayout.Label ("Fog",headerStyle);
|
|
EditorGUI.indentLevel++;
|
|
EditorGUILayout.PropertyField (fogPower, true, null);
|
|
if(myTarget.fogPower == EnviroWorldAPIIntegration.GetSet.SendToWAPI)
|
|
EditorGUILayout.PropertyField (fogPowerMult, true, null);
|
|
EditorGUI.indentLevel--;
|
|
GUILayout.EndVertical ();
|
|
GUILayout.EndVertical ();
|
|
if (EditorGUI.EndChangeCheck ()) {
|
|
serializedObj.ApplyModifiedProperties ();
|
|
}
|
|
}
|
|
}
|
|
#endif |