【Unity】How to use Unity to get the Windows desktop

【background】

The default screen sharing that Unity can achieve is only for the content displayed by the Camera in the editing window of the Unity editor. This article studies how to use Unity to reflect the Windows desktop window screen in real time.

【Prepare plug-in】

Download location:
https://download.csdn.net/download/weixin_41697242/88623496

Place the unzipped folder directly into the project Assets.

【Example analysis】

There are many samples in the Sample folder in the import folder for reference.
Open the Desktop scene under Example, and you can find the only Desktop object in the Hierarchy that needs attention.
Insert image description here

There is a script component called Uwc Window Texure hanging under this object. You can directly copy this Desktop object to use in your own scene.
Directly run the Desktop scene of Excample and you will find that the desktop image is obtained directly. Insert image description here

Guess you like

Origin blog.csdn.net/weixin_41697242/article/details/134960994