RaptorCredits
Registry of bundled third-party components and their licences.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
Settings → Legal → Credits lists one row per credit, with its title, component, licence and a View licence action. This class's static constructor registers RAPTOR's credits first. Module and project credits follow in registration order.
A credit's id matches its row in the package's notices data (notices.json). Rows in the same notices section share one credit. The licence path is resolved when the row needs it. If that file is missing, the package's NoticesFileName is used. If both are missing, the row shows Missing.
Register from an [InitializeOnLoad] static constructor on the main thread. The first credit registered with an id is kept. A path callback that throws is logged and does not affect other credits.
public static class RaptorCreditsFields
DataFontId
public const string DataFontId;Id of RAPTOR's data typeface credit (a row of the package's notices data).
MeshCoreId
public const string MeshCoreId;Id of the credit titled Mesh tools: the mesh tools library (a row of the package's notices data).
NoticesFileName
public const string NoticesFileName;The package's plain-text notices file, written at the package root by the exporter.
NumberFontId
public const string NumberFontId;Id of the Suite's number typeface credit (a row of the package's notices data).
SboxId
public const string SboxId;Id of the credit titled Mesh core: the upstream of the hotspot mapping (a row of the package's notices data).
StarterId
public const string StarterId;Id of the starter textures' credit. Registered only when the starter folder exists.
WordFontId
public const string WordFontId;Id of the Suite's word typeface credit (a row of the package's notices data).
Properties
All
public static IReadOnlyList<RaptorCredit> All { get; }Gets every credit: RAPTOR's first, then the rest in registration order.
Count
public static int Count { get; }Gets the number of registered credits.
NoticesPath
public static string NoticesPath { get; }Gets the path of the package's notices file under RaptorPaths.Root.
Methods
Describe
public static string Describe(RaptorCredit credit)Returns the row's description in the form "component, licence words licence" (e.g. "Roboto Mono, OFL licence").
| Parameter | Type | Description |
|---|---|---|
credit | RaptorCredit | The credit. |
Returns: The description.
Find
public static RaptorCredit Find(string id)Returns the credit with this id, or null.
| Parameter | Type | Description |
|---|---|---|
id | string | The credit's id. |
Returns: The credit or null.
IsRegistered
public static bool IsRegistered(string id)Whether a credit with this id is registered.
| Parameter | Type | Description |
|---|---|---|
id | string | The credit's id. |
Returns: True when registered.
LicenceWords
public static string LicenceWords(string spdx)Returns the display words for an SPDX expression: "ISC", "MIT", "Apache 2.0", "OFL", "CC0", "ISC and MIT". A LicenseRef- id returns its name in lower case ("unknown").
| Parameter | Type | Description |
|---|---|---|
spdx | string | An SPDX licence id or expression. |
Returns: The words.
Open
public static void Open(string path)Opens a licence or notices file in the editor. A package path reveals the file on disk.
| Parameter | Type | Description |
|---|---|---|
path | string | A project path (Assets/... or Packages/...). |
Register
public static bool Register(RaptorCredit credit)Adds a credit after those already registered. Returns false when a credit with this id is already registered.
| Parameter | Type | Description |
|---|---|---|
credit | RaptorCredit | The credit to add. |
Returns: True when the credit was added.
Call from an [InitializeOnLoad] static constructor on the main thread.
ViewPath
public static string ViewPath(RaptorCredit credit)Returns the project path that View licence opens: the credit's licence file if it exists, otherwise the package's notices file if it exists, otherwise null.
| Parameter | Type | Description |
|---|---|---|
credit | RaptorCredit | The credit. |
Returns: A project path or null.
Related types
- RaptorCredit: One bundled third-party component and its licence.
- RaptorPaths: Resolves RAPTOR's install and data folders.