浏览代码

add dpr override setting

/main
xingweizhu 3 年前
当前提交
f2b5f40f
共有 2 个文件被更改,包括 7 次插入4 次删除
  1. 1
      com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
  2. 10
      com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs

1
com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs


public override void OnInspectorGUI() {
base.OnInspectorGUI();
EditorGUILayout.PropertyField(serializedObject.FindProperty("fonts"), true);
EditorGUILayout.PropertyField(serializedObject.FindProperty("devicePixelRatioEditorOnlyOverride"), new GUIContent(text: "[EditorOnly]DPR Override"), false);
EditorGUI.BeginChangeCheck();
UIWidgetsPanel panel = (UIWidgetsPanel)target;
serializedObject.ApplyModifiedProperties();

10
com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs


panels.Remove(panel);
}
float _devicePixelRatioOverride;
public bool hardwareAntiAliasing;
public float devicePixelRatioEditorOnlyOverride;
public TextFont[] fonts;
Configurations _configurations;

#if !UNITY_EDITOR
return _wrapper.displayMetrics.DevicePixelRatioByDefault;
#endif
if (devicePixelRatioEditorOnlyOverride != 0) {
return devicePixelRatioEditorOnlyOverride;
}
var currentDpi = Screen.dpi;
if (currentDpi == 0) {
currentDpi = canvas.GetComponent<CanvasScaler>().fallbackScreenDPI;

正在加载...
取消
保存