using System ;
using System.Collections.Generic ;
using System.Diagnostics ;
using System.Linq ;
using Unity.UIWidgets.engine ;
public static bool debugPrintMouseHoverEvents = false ;
public const string debugScriptingDefineSymbol = "DebugUIWidgets" ;
public static HSVColor debugCurrentRepaintColor =
HSVColor . fromAHSV ( 0.4f , 6 0.0f , 1.0f , 1.0f ) ;
Debug . LogException ( new AssertionError ( message : message , innerException : ex ) ) ;
}
[Conditional("UNITY_ASSERTIONS")]
[Conditional(debugScriptingDefineSymbol)]
[Conditional("UNITY_ASSERTIONS")]
[Conditional(debugScriptingDefineSymbol)]
public static void assert ( bool result , Func < string > message = null ) {
if ( enableDebug & & ! result ) {
throw new AssertionError ( message ! = null ? message ( ) : "" ) ;
#if UNITY_EDITOR
static bool? _enableDebug = null ;
private static void setRuntimeSymbolsForTarget ( BuildTargetGroup targetGroup , bool enabled ) {
string defines = PlayerSettings . GetScriptingDefineSymbolsForGroup ( targetGroup ) ;
var defineList = defines . Split ( ';' ) ;
var newDefineList = new List < string > ( ) ;
foreach ( var define in defineList ) {
if ( define ! = debugScriptingDefineSymbol ) {
newDefineList . Add ( define ) ;
}
}
if ( enabled ) {
newDefineList . Add ( debugScriptingDefineSymbol ) ;
}
PlayerSettings . SetScriptingDefineSymbolsForGroup ( targetGroup , String . Join ( ";" , newDefineList ) ) ;
}
public static bool enableDebug {
get {
if ( _enableDebug = = null ) {
}
_enableDebug = value ;
EditorPrefs . SetInt ( "UIWidgetsDebug" , value ? 1 : 0 ) ;
setRuntimeSymbolsForTarget ( BuildTargetGroup . Android , value ) ;
setRuntimeSymbolsForTarget ( BuildTargetGroup . iOS , value ) ;
setRuntimeSymbolsForTarget ( BuildTargetGroup . Standalone , value ) ;
public static bool enableDebug = > UIWidgetsGlobalConfiguration . EnableDebugAtRuntime ;
//In runtime, we use the Conditional decorator "debugScriptingDefineSymbol" instead of this to enable/disable debug mode
public static bool enableDebug = > true ;
#endif
public static void _debugDrawDoubleRect ( Canvas canvas , Rect outerRect , Rect innerRect , Color color ) {