File tree Expand file tree Collapse file tree
Modules/DeviceSimulatorEditor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,9 +263,15 @@ protected string GetWindowTitle(Type type)
263263 return attributes . Length > 0 ? ( ( EditorWindowTitleAttribute ) attributes [ 0 ] ) . title : type . Name ;
264264 }
265265
266+ protected static string GetLocalizedWindowTitle ( Type type )
267+ {
268+ var attributes = type . GetCustomAttributes ( typeof ( EditorWindowTitleAttribute ) , true ) ;
269+ return attributes . Length > 0 ? EditorGUIUtility . TrTextContent ( ( ( EditorWindowTitleAttribute ) attributes [ 0 ] ) . title ) . text : type . Name ;
270+ }
271+
266272 protected Dictionary < Type , string > GetAvailableWindowTypes ( )
267273 {
268- return m_AvailableWindowTypes ?? ( m_AvailableWindowTypes = TypeCache . GetTypesDerivedFrom ( typeof ( PlayModeView ) ) . OrderBy ( GetWindowTitle ) . ToDictionary ( t => t , GetWindowTitle ) ) ;
274+ return m_AvailableWindowTypes ?? ( m_AvailableWindowTypes = TypeCache . GetTypesDerivedFrom ( typeof ( PlayModeView ) ) . OrderBy ( GetWindowTitle ) . ToDictionary ( t => t , GetLocalizedWindowTitle ) ) ;
269275 }
270276
271277 private void SetSerializedViews ( Dictionary < string , string > serializedViews )
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ void OnEnable()
5858 private void InitPlayModeViewSwapMenu ( )
5959 {
6060 var playModeViewTypeMenu = rootVisualElement . Q < ToolbarMenu > ( "playmode-view-menu" ) ;
61- playModeViewTypeMenu . text = GetWindowTitle ( GetType ( ) ) ;
61+ playModeViewTypeMenu . text = GetLocalizedWindowTitle ( GetType ( ) ) ;
6262
6363 var types = GetAvailableWindowTypes ( ) ;
6464 foreach ( var type in types )
Original file line number Diff line number Diff line change 1- ## Unity 2022.1.3f1 C# reference source code
1+ ## Unity 2022.1.4f1 C# reference source code
22
33The C# part of the Unity engine and editor source code.
44May be used for reference purposes only.
You can’t perform that action at this time.
0 commit comments