Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

LicensingUtility

class in UnityEditor.Licensing

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

Description

Queries the entitlements granted to the current user.

An entitlement is a string that identifies a permission, for example com.unity.editor.ui. Unity resolves entitlements through the licensing system, which the Editor cannot always reach.

Every entitlement check on this class fails closed: an unreachable licensing system reads the same as an entitlement that is not granted. This is the right default for gating a feature, where both cases deny access.

Use LicensingUtility.HasEntitlement for a single entitlement, LicensingUtility.HasEntitlements for several, and LicensingUtility.HasEntitlementsExtended when you need the license files behind an entitlement or the custom data attached to it.

using UnityEditor.Licensing;
using UnityEngine;

static class LicenseReport { public static void LogEditorEntitlements() { // An unreachable licensing system returns an empty array, the same as nothing being granted. string[] granted = LicensingUtility.HasEntitlements(new[] { "com.unity.editor.ui", "com.unity.editor.disable-splash-screen", });

foreach (var entitlement in granted) { Debug.Log($"{entitlement} is granted"); } } }

Static Methods

Method Description
GetAuthTokenReturns the authentication token for the current licensing session.
HasEduLicenseChecks whether the current user has an Education license.
HasEntitlementChecks whether the current user is entitled to a specific entitlement.
HasEntitlementsReturns which of a list of entitlements are granted to the current user.
HasEntitlementsExtendedReturns extended information about a list of entitlements.
HasProChecks whether the current user has a Unity Pro license.
InvokeLicenseUpdateCallbacksNotifies all components that have registered to act upon licensing changes.
IsPersonalChecks whether the current user has a Unity Personal license.
UpdateLicenseTriggers an update to all available license types found on this machine.