diff --git a/Assets/uWindowCapture/Editor/UwcWindowTextureEditor.cs b/Assets/uWindowCapture/Editor/UwcWindowTextureEditor.cs index 5f7a61a..0df883a 100644 --- a/Assets/uWindowCapture/Editor/UwcWindowTextureEditor.cs +++ b/Assets/uWindowCapture/Editor/UwcWindowTextureEditor.cs @@ -47,6 +47,7 @@ string error SerializedProperty captureRequestTiming; SerializedProperty captureFrameRate; SerializedProperty drawCursor; + SerializedProperty defaultTexture; SerializedProperty scaleControlType; SerializedProperty scalePer1000Pixel; @@ -60,6 +61,7 @@ void OnEnable() captureRequestTiming = serializedObject.FindProperty("captureRequestTiming"); captureFrameRate = serializedObject.FindProperty("captureFrameRate"); drawCursor = serializedObject.FindProperty("drawCursor"); + defaultTexture = serializedObject.FindProperty("defaultTexture"); scaleControlType = serializedObject.FindProperty("scaleControlType"); scalePer1000Pixel = serializedObject.FindProperty("scalePer1000Pixel"); } @@ -150,6 +152,7 @@ void DrawCaptureSettings() EditorGUILayout.PropertyField(captureRequestTiming); EditorGUILayout.PropertyField(captureFrameRate); EditorGUILayout.PropertyField(drawCursor); + EditorGUILayout.PropertyField(defaultTexture); EditorGUILayout.Space(); } @@ -189,4 +192,4 @@ void DrawWindowInformation() } } -} \ No newline at end of file +} diff --git a/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs b/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs index db463a8..9459583 100644 --- a/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs +++ b/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs @@ -133,6 +133,7 @@ public int desktopIndex public WindowTextureCaptureTiming captureRequestTiming = WindowTextureCaptureTiming.OnlyWhenVisible; public int captureFrameRate = 30; public bool drawCursor = true; + public Texture defaultTexture = null; public bool updateTitle = true; public bool searchAnotherWindowWhenInvalid = false; @@ -226,7 +227,7 @@ void Update() UpdateTargetWindow(); if (!isValid) { - material_.mainTexture = null; + material_.mainTexture = defaultTexture; return; } @@ -438,4 +439,4 @@ static public RayCastResult RayCast(Vector3 from, Vector3 dir, float distance, L } } -} \ No newline at end of file +}