NOA DebuggerNOA Debugger
  • v1.7.0
  • v1.6.1
  • v1.5.0
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.1
  • v1.0.0
Demo
Contact
Buy
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • v1.7.0
  • v1.6.1
  • v1.5.0
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.1
  • v1.0.0
Demo
Contact
Buy
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • NoaScreenshotCallbacks

NoaScreenshotCallbacks

Configure events related to the screenshot feature.

By passing a class that inherits NoaScreenshotCallbacks to NoaController, you can customize events related to the screenshot feature.

Overridable Members

Methods

NameDescription
OnBeforePrepareScreenshot()Executed before controlling the NOA Debugger UI display according to the ScreenshotTarget described below. By changing ScreenshotTarget here, execute OnCaptureScreenshot with unnecessary NOA Debugger UI hidden.
OnCaptureScreenshot()Executed immediately before NOA Debugger’s screenshot process.
OnAfterScreenshot()Executed after the screenshot process. Executed even if NOA Debugger’s screenshot process was not executed.

Properties

NameDescription
IsAllowBaseScreenshotDetermines whether to execute NOA Debugger’s screenshot process. Default is true; if set to false, the screenshot process is not executed.
ScreenshotTargetSpecifies the NOA Debugger UI to preserve as visible during screenshot capture. Default is None, which captures with all NOA Debugger UI hidden.

Related Types

INoaScreenshotCallbacks

The overridable methods and properties of NoaScreenshotCallbacks are defined in this interface.

If you want to consolidate multiple callback definitions in a custom class, or add callback functionality while inheriting an existing custom class, you can achieve this by using this interface instead of the NoaScreenshotCallbacks class.

NoaController.ScreenshotTarget

A [Flags] enum used by NoaScreenshotCallbacks properties to specify screenshot targets.

Capture with NOA Debugger UI not included in the targets hidden.

ItemDescription
NoneCapture with all NOA Debugger UI hidden. Note: Because other flags take precedence, use None by itself.
LaunchButtonInclude launch button in the capture targets.
FloatingWindowsInclude floating windows in the capture targets.
UIElementInclude UI elements in the capture targets.
MainViewInclude main view in the capture targets.
OverlaysInclude overlays in the capture targets.
AllInclude all NOA Debugger UI in the capture targets.

Sample Code

#if NOA_DEBUGGER
using NoaDebugger;
using UnityEngine;

// Example of executing events before and after NOA Debugger’s screenshot process.
public class ExampleScreenshotManager : NoaScreenshotCallbacks
{
    NoaController.ScreenshotTarget target;
    public override NoaController.ScreenshotTarget ScreenshotTarget => target;

    public override void OnBeforePrepareScreenshot()
    {
        // Example of changing whether to include NOA Debugger UI in the screenshot depending on the current scene.
        if (ExampleSceneManager.Instance.CurrentScene == SceneType.Battle)
        {
            target = NoaController.ScreenshotTarget.UIElement | NoaController.ScreenshotTarget.Overlays;
        }
        else
        {
            target = NoaController.ScreenshotTarget.None;
        }
    }

    public override void OnAfterScreenshot()
    {
        byte[] data = NoaController.GetCapturedScreenshot();

        if (data != null)
        {
            // Example of saving the image data to a file.
            string filePath = Application.persistentDataPath + "/screenshot.png";
            System.IO.File.WriteAllBytes(filePath, data);
            Debug.Log($"Screenshot saved to: {filePath}");

            // Clear the captured screenshot image.
            NoaController.ClearCapturedScreenshot();
        }
        else
        {
            Debug.LogError("No screenshot data.");
        }
    }
}

// Example of executing a custom process without executing NOA Debugger’s screenshot process.
public class ExampleOriginalScreenshotManager : NoaScreenshotCallbacks
{
    // Set IsAllowBaseScreenshot to false to prevent execution of NOA Debugger’s screenshot process.
    public override bool IsAllowBaseScreenshot => false;

    // Because the default display-control process is triggered, you can execute your custom capture process with NOA Debugger UI hidden.
    public override void OnCaptureScreenshot()
    {
        ScreenCapture.CaptureScreenshot("screenshot.png");
    }
}
#endif

Links

Related Features

  • Launching Tool

Classes Used

  • NoaController