Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

DeeplinkHandlerAttribute Constructor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public DeeplinkHandlerAttribute(string value);

Parameters

Parameter Description
handlerNamespace The namespace of the deeplink handler. This parameter is case-insensitive.

Description

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.

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

// 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}"); } } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961