浏览代码

minor fixes

/siyaoH-1.17-PlatformMessage
Xingwei Zhu 4 年前
当前提交
542a0018
共有 4 个文件被更改,包括 5 次插入23 次删除
  1. 6
      com.unity.uiwidgets/Editor/UIWidgetsPanelEditor.cs
  2. 5
      com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs
  3. 13
      com.unity.uiwidgets/Runtime/foundation/debug.cs
  4. 4
      engine/src/shell/platform/unity/darwin/macos/unity_surface_manager.mm

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


EditorGUILayout.PropertyField(serializedObject.FindProperty("fonts"), true);
EditorGUI.BeginChangeCheck();
UIWidgetsPanel panel = (UIWidgetsPanel)target;
panel.enableDebugAtRuntime = EditorGUILayout.Toggle(new GUIContent("Enable Debug At Runtime",
"This configuration only works in standalone players. \n\n" +
"If your scene contains multiple UIWidgets panels," +
" the DEBUG MODE is enabled for all panels if this is checked on any one panel.\n\n" +
"In editor the DEBUG MODE can be set using UIWidgets/EnableDebug."),
panel.enableDebugAtRuntime);
serializedObject.ApplyModifiedProperties();
}

5
com.unity.uiwidgets/Runtime/engine2/UIWidgetsPanel.cs


public partial class UIWidgetsPanel : RawImage, IUIWidgetsWindow {
static List<UIWidgetsPanel> panels = new List<UIWidgetsPanel>();
static bool showDebugLog = false;
showDebugLog = showDebugLog || panel.enableDebugAtRuntime;
public static bool enableDebug => showDebugLog;
public bool enableDebugAtRuntime = false;

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


Debug.LogException(new AssertionError(message: message, innerException: ex));
}
static int checkRound = 0;
if (enableDebug) {
checkRound += 1;
if (checkRound % 100000 == 0) {
Debug.Log("Assertion called !!!!!!!!!!!!!!!");
}
}
if ( enableDebug && !result() ) {
throw new AssertionError(message != null ? message() : "");
}

}
}
#else
public static bool enableDebug => UIWidgetsPanel.enableDebug;
private const bool internalEnableDebugAtRuntime = false;
public static bool enableDebug => internalEnableDebugAtRuntime;
#endif
public static void _debugDrawDoubleRect(Canvas canvas, Rect outerRect, Rect innerRect, Color color) {

4
engine/src/shell/platform/unity/darwin/macos/unity_surface_manager.mm


glDeleteTextures(1, &gl_tex_);
gl_tex_ = 0;
CFRelease(gl_tex_cache_ref_);
CVOpenGLTextureCacheRelease(gl_tex_cache_ref_);
CFRelease(gl_tex_ref_);
CVOpenGLTextureRelease(gl_tex_ref_);
gl_tex_ref_ = nullptr;
//release metal resources

正在加载...
取消
保存