From 8b1c0ce92b3450d7b2054ac7c23db4d755e27d43 Mon Sep 17 00:00:00 2001 From: xpeng <1216772231@qq.com> Date: Wed, 8 Jun 2022 02:27:32 +0200 Subject: [PATCH] fix capture white scree issue (maybe) --- .gitignore | 22 +++++++++++++++---- ...ngs.lighting => Default Lighting.lighting} | 2 +- ...ng.meta => Default Lighting.lighting.meta} | 0 Assets/Scenes/WACVR.unity | 2 +- Assets/uWindowCapture/Runtime/UwcManager.cs | 4 +++- .../Runtime/UwcWindowTexture.cs | 4 +++- 6 files changed, 26 insertions(+), 8 deletions(-) rename Assets/{TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting => Default Lighting.lighting} (98%) rename Assets/{TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting.meta => Default Lighting.lighting.meta} (100%) diff --git a/.gitignore b/.gitignore index 9efdfe4..e503dab 100644 --- a/.gitignore +++ b/.gitignore @@ -8,16 +8,20 @@ /[Bb]uild/ /[Bb]uilds/ /[Ll]ogs/ +/[Uu]ser[Ss]ettings/ + +# MemoryCaptures can get excessive in size. +# They also could contain extremely sensitive data /[Mm]emoryCaptures/ -# Asset meta data should only be ignored when the corresponding asset is also ignored -!/[Aa]ssets/**/*.meta +# Recordings can get excessive in size +/[Rr]ecordings/ # Uncomment this line if you wish to ignore the asset store tools plugin # /[Aa]ssets/AssetStoreTools* # Autogenerated Jetbrains Rider plugin -[Aa]ssets/Plugins/Editor/JetBrains* +/[Aa]ssets/Plugins/Editor/JetBrains* # Visual Studio cache directory .vs/ @@ -53,11 +57,20 @@ sysinfo.txt # Builds *.apk +*.aab *.unitypackage +*.app # Crashlytics generated file crashlytics-build.properties +# Packed Addressables +/[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* + +# Temporary auto-generated Android Assets +/[Aa]ssets/[Ss]treamingAssets/aa.meta +/[Aa]ssets/[Ss]treamingAssets/aa/* + # WACVR-specific uWindowCapture.log @@ -65,4 +78,5 @@ uWindowCapture.log .vscode/ # Game configuration file -config.json \ No newline at end of file +config.json + diff --git a/Assets/TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting b/Assets/Default Lighting.lighting similarity index 98% rename from Assets/TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting rename to Assets/Default Lighting.lighting index b71c536..027ec3b 100644 --- a/Assets/TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting +++ b/Assets/Default Lighting.lighting @@ -6,7 +6,7 @@ LightingSettings: m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_Name: New Lighting Settings + m_Name: Default Lighting serializedVersion: 4 m_GIWorkflowMode: 0 m_EnableBakedLightmaps: 1 diff --git a/Assets/TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting.meta b/Assets/Default Lighting.lighting.meta similarity index 100% rename from Assets/TextMesh Pro/Resources/Style Sheets/New Lighting Settings.lighting.meta rename to Assets/Default Lighting.lighting.meta diff --git a/Assets/Scenes/WACVR.unity b/Assets/Scenes/WACVR.unity index 43c2b21..c234b25 100644 --- a/Assets/Scenes/WACVR.unity +++ b/Assets/Scenes/WACVR.unity @@ -2138,7 +2138,7 @@ MonoBehaviour: createChildWindows_: 0 childWindowPrefab: {fileID: 0} childWindowZDistance: 0.02 - partialWindowTitle_: Mercury + partialWindowTitle_: 'Mercury ' desktopIndex_: 0 captureMode: 1 capturePriority: 0 diff --git a/Assets/uWindowCapture/Runtime/UwcManager.cs b/Assets/uWindowCapture/Runtime/UwcManager.cs index c365e0a..57fb79c 100644 --- a/Assets/uWindowCapture/Runtime/UwcManager.cs +++ b/Assets/uWindowCapture/Runtime/UwcManager.cs @@ -174,7 +174,8 @@ public class UwcManager : MonoBehaviour { Lib.Update(Time.deltaTime); UpdateWindowInfo(); - UpdateMessages(); + if (!UwcWindowTexture.isWindowCaptured) + UpdateMessages(); UpdateWindowTitles(); } @@ -210,6 +211,7 @@ public class UwcManager : MonoBehaviour } case MessageType.WindowRemoved: { var window = Find(id); + Debug.Log(id); if (window != null) { window.isAlive = false; if (window.parentWindow != null) { diff --git a/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs b/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs index db463a8..ff23116 100644 --- a/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs +++ b/Assets/uWindowCapture/Runtime/UwcWindowTexture.cs @@ -196,6 +196,7 @@ public class UwcWindowTexture : MonoBehaviour return window != null && window.isValid; } } + static public bool isWindowCaptured = false; Material material_; Renderer renderer_; @@ -224,7 +225,8 @@ public class UwcWindowTexture : MonoBehaviour { UpdateSearchTiming(); UpdateTargetWindow(); - + if (!isWindowCaptured) + isWindowCaptured = window != null && window.isValid; if (!isValid) { material_.mainTexture = null; return;