浏览代码

add check marks

/siyaoH-1.17-PlatformMessage
Shiyun Wen 4 年前
当前提交
0289b75f
共有 2 个文件被更改,包括 27 次插入16 次删除
  1. 13
      Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/GalleryMain.cs
  2. 30
      com.unity.uiwidgets/Runtime/foundation/debug.cs

13
Samples/UIWidgetsSamples_2019_4/Assets/Editor/EditorWindowSample/GalleryMain.cs


{
public class EditorWindowGallery : UIWidgetsEditorPanel
{
[MenuItem("UIWidgets/SetDebugLog")]
public static void SetDebugMode()
{
if (PlayerPrefs.GetInt("DisableDebugMode") == 1)
{
PlayerPrefs.SetInt("DisableDebugMode",0);
}
else
{
PlayerPrefs.SetInt("DisableDebugMode",1);
}
UIWidgetsPanel.ShowDebugLog = PlayerPrefs.GetInt("DisableDebugMode") == 1 ? false : true;
}
[MenuItem("UIWidgets/EditorSample")]
public static void CountDemo()

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


using Unity.UIWidgets.engine2;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using UnityEditor;
using UnityEngine;
using Canvas = Unity.UIWidgets.ui.Canvas;
using Color = Unity.UIWidgets.ui.Color;
using Debug = UnityEngine.Debug;

public static class D {
public static bool debugPrintGestureArenaDiagnostics = false;

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

if (UIWidgetsPanel.ShowDebugLog && !result ) {
if ( _enableDebug && !result ) {
}
}
public static bool _enableDebug {
get {
return EditorPrefs.GetBool("EnableDebugLog");
}
set {
EditorPrefs.SetBool("EnableDebugLog",value);
}
}
[MenuItem("UIWidgets/ShowDebugLog")]
public static void ShowDebugLog(){
_enableDebug = !_enableDebug;
}
[MenuItem("UIWidgets/ShowDebugLog",true)]
public static bool ShowDebugLogValidate(){
Menu.SetChecked("UIWidgets/ShowDebugLog", _enableDebug );
return true;
}
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {
var path = new Path();
path.fillType = PathFillType.evenOdd;

正在加载...
取消
保存