SkillAgentSearch skills...

McDesktopCapture

Unity Asset to capture the macOS desktop as Texture2D

Install / Use

/learn @fuziki/McDesktopCapture
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

mcDesktopCapture

Platform Unity Xode

Unity native plugin to capture the macOS desktop as Texture2D

<video src="https://user-images.githubusercontent.com/33706353/180478830-64fae2ab-321e-4d88-9eb6-b6dfc121da31.mp4"></video>

Installation

  • Download mcDesktopCapture.unitypakcage from Releases and install it in your project.
  • To allow monitoring of keyboard input in the background, you need to add Unity to Privacy Settings.
  • Open System Preferences > Security & Privacy > Privacy > Screen Recording and add Unity.app.
    (And Unity Hub.app if you use)
<img src="docs/images/screen-recording.png" width="600">

Usage

| | mcDesktopCapture | mcDesktopCapture2 | | :--- | :--- | :--- | | Unity | Unity 2021.X<br>Unity 2022.X<br>Unity 2022.2+ (Apple Silicon) | Unity 2021.X<br>Unity 2022.X<br>Unity 2022.2+ (Apple Silicon) | | Platform | macOS 12+ (Apple Silicon and Intel) | macOS 12.3+ (Apple Silicon and Intel) | | Technology | Quartz Display Services | ScreenCaptureKit | | Capturing | Entire Display | Each windows |

mcDesktopCapture

Start capture

var list = DesktopCapture.DisplayList;
DesktopCapture.StartCapture(list[0].id);

Set Texture

var texture = DesktopCapture.GetTexture2D();
if (texture == null) return;
Renderer m_Renderer = GetComponent<Renderer>();
m_Renderer.material.SetTexture("_MainTex", texture);

Stop capture

DesktopCapture.StopCapture();

mcDesktopCapture2

  • Support macOS 12.3+
  • Based on ScreenCaptureKit
  • This feature is able to capture each window.

Start capture

DesktopCapture2.Init();
var list = DesktopCapture2.WindowList;
var window = list[0];
DesktopCapture2.StartCaptureWithWindowID(window.windowID, window.frame.width, window.frame.height, true);

Set Texture

var texture = DesktopCapture2.GetTexture2D();
if (texture == null) return;
Renderer m_Renderer = GetComponent<Renderer>();
m_Renderer.material.SetTexture("_MainTex", texture);

Stop capture

DesktopCapture2.StopCapture();
DesktopCapture2.Destroy();
View on GitHub
GitHub Stars23
CategoryDevelopment
Updated4mo ago
Forks2

Languages

Swift

Security Score

92/100

Audited on Nov 18, 2025

No findings