|
|
|
|
|
|
|
|
|
|
[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); |
|
|
|