浏览代码

update debug.cs

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
ab98f443
共有 1 个文件被更改,包括 15 次插入8 次删除
  1. 23
      com.unity.uiwidgets/Runtime/foundation/debug.cs

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


[Conditional("UNITY_ASSERTIONS")]
public static void assert(Func<bool> result, Func<string> message = null) {
if ( _enableDebug && !result() ) {
if (enableDebug != _enableDebug) {
enableDebug = _enableDebug;
}
if ( enableDebug && !result() ) {
throw new AssertionError(message != null ? message() : "");
}
}

if ( _enableDebug && !result ) {
if (enableDebug != _enableDebug) {
enableDebug = _enableDebug;
}
if ( enableDebug && !result ) {
static bool enableDebug;
public static bool _enableDebug {
get {
return EditorPrefs.GetBool("EnableDebugLog");

}
}
[MenuItem("UIWidgets/ShowDebugLog")]
[MenuItem("UIWidgets/EnableDebug")]
enableDebug = _enableDebug;
[MenuItem("UIWidgets/ShowDebugLog",true)]
[MenuItem("UIWidgets/EnableDebug",true)]
Menu.SetChecked("UIWidgets/ShowDebugLog", _enableDebug );
Menu.SetChecked("UIWidgets/EnableDebug", _enableDebug );
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
var path = new Path();
path.fillType = PathFillType.evenOdd;
path.addRect(rect: outerRect);

正在加载...
取消
保存