From 78b128bdff52e944ac771815690e5ac5e58c1c4f Mon Sep 17 00:00:00 2001 From: Xingwei Zhu Date: Sat, 7 May 2022 15:55:10 +0800 Subject: [PATCH] refine code --- com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs b/com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs index 9bc66f8a..45a43df2 100644 --- a/com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs +++ b/com.unity.uiwidgets/Editor/UIWidgetsEditorPanel.cs @@ -121,6 +121,10 @@ namespace Unity.UIWidgets.Editor { return; } + if (_wrapper.renderTexture == null) { + return; + } + EditorGUI.DrawPreviewTexture(new Rect(0.0f, 0.0f, width: position.width, height: position.height), image: _wrapper.renderTexture, mat: _uiMaterial); Input_OnGUIEvent(evt: Event.current);