浏览代码

Merge branch 'dev_1.17.5' into siyaoH/1.17/android

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
023d5203
共有 2 个文件被更改,包括 15 次插入19 次删除
  1. 13
      com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
  2. 21
      com.unity.uiwidgets/Runtime/foundation/debug.cs

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


using Unity.UIWidgets.engine;
using Unity.UIWidgets.engine2;
using Unity.UIWidgets.foundation;
using UnityEditor;
using UnityEditor.UI;
using UnityEngine;

EditorGUI.BeginChangeCheck();
UIWidgetsPanel panel = (UIWidgetsPanel)target;
serializedObject.ApplyModifiedProperties();
}
[MenuItem("UIWidgets/EnableDebug")]
public static void ToggleDebugMode(){
D.enableDebug = !D.enableDebug;
}
[MenuItem("UIWidgets/EnableDebug",true)]
public static bool CurrentDebugModeState() {
Menu.SetChecked("UIWidgets/EnableDebug", D.enableDebug );
return true;
}
}
}

21
com.unity.uiwidgets/Runtime/foundation/debug.cs


using System.Linq;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;

}
static bool? _enableDebug = null;
static bool enableDebug {
public static bool enableDebug {
get {
if (_enableDebug == null) {
_enableDebug = PlayerPrefs.GetInt("UIWidgetsDebug") == 1;

PlayerPrefs.SetInt("UIWidgetsDebug",value ? 1 : 0);
}
}
#if UNITY_EDITOR
[MenuItem("UIWidgets/EnableDebug")]
public static void ToggleDebugMode(){
enableDebug = !enableDebug;
}
#endif
#if UNITY_EDITOR
[MenuItem("UIWidgets/EnableDebug",true)]
public static bool CurrentDebugModeState() {
Menu.SetChecked("UIWidgets/EnableDebug", enableDebug );
return true;
}
#endif
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
var path = new Path();
path.fillType = PathFillType.evenOdd;

正在加载...
取消
保存