Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DeeplinkHandlerAttribute(string)

This public static method attribute allows you to register a deeplink handler for application-level deeplinks received by the Unity Editor that match a given namespace. It requires the UnityEditor namespace and can only be used in the Unity Editor.
Read time 1 minuteLast updated 11 days ago

Definition

  • Type: Constructor
  • Namespace: UnityEditor
  • Assembly: UnityEditor
public DeeplinkHandlerAttribute(string value)

Parameters

value

Remarks

Decorated methods are analyzed and signaled as validated or unvalidated when a deeplink is forwarded to them. Only decorated methods that belong to a package delivered through a Unity Package Manager registry are signaled as validated. Unvalidated methods require the end-user to manually validate the deeplink operation through a dialog prompt.

Examples

// Example script that decorates a public static method to serve as a deeplink handler// for com.unity.editor://editor/my.namespace.editor/* formatted urls.using System;using UnityEngine;using UnityEditor;namespace My.Namespace.Editor{ public class MyClass { // OnDeeplinkActivated will receive com.unity.editor://editor/my.namespace.editor/* formatted urls. [DeeplinkHandler("My.Namespace.Editor")] public static void OnDeeplinkActivated(Uri uri) { Debug.Log($"Received deeplink: {uri.AbsoluteUri}"); } }}