Class ScyllaDependencyDetector
Detects the installation status of Scylla dependencies across all supported source types. Handles UPM packages (via the Package Manager API), Asset Store and third-party packages (via reflection-based type detection), and other Scylla modules (via IScyllaDependencyProvider discovery).
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
public sealed class ScyllaDependencyDetector
Remarks
Package lists are populated asynchronously through RefreshInstalledPackages(Action). Until a refresh completes, UPM package status is reported as Unknown. Call IsRefreshing to check whether a refresh is in progress.
UPM package installation is supported through InstallUPMPackage(string, Action<bool, string>). Only one installation can be in progress at a time; check IsInstalling before initiating a new install.
Constructors
ScyllaDependencyDetector()
Initializes a new ScyllaDependencyDetector with an empty package cache. Call RefreshInstalledPackages(Action) after construction to populate the cache before querying UPM dependency statuses.
Declaration
public ScyllaDependencyDetector()
Properties
InstalledPackages
Gets the cached dictionary of installed UPM packages, keyed by package name
(e.g., "com.unity.inputsystem"). Populated after each call to
RefreshInstalledPackages(Action) completes. May be empty if a refresh has not
yet been performed; check IsRefreshing to distinguish an in-progress
refresh from a completed one with no packages.
Declaration
public IReadOnlyDictionary<string, PackageInfo> InstalledPackages { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<string, PackageInfo> | A read-only view of the cached package dictionary. Never |
IsInstalling
Gets a value indicating whether a UPM package installation is currently in progress. Only one installation can run at a time; check this property before calling InstallUPMPackage(string, Action<bool, string>) to avoid concurrent install conflicts.
Declaration
public bool IsInstalling { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
IsRefreshing
Gets a value indicating whether a package-list refresh is currently in progress.
While true, UPM dependency status queries may return
Unknown for packages not yet cached.
Declaration
public bool IsRefreshing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Methods
AreAllRequiredDependenciesInstalled(IEnumerable<ScyllaDependencyInfo>)
Determines whether every dependency in the provided sequence that is marked as required
(IsRequired is true) is currently installed
with a passing status.
Declaration
public bool AreAllRequiredDependenciesInstalled(IEnumerable<ScyllaDependencyInfo> dependencies)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ScyllaDependencyInfo> | dependencies | The collection of dependencies to check. Must not be |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Optional dependencies (where IsRequired is false)
are skipped. A dependency is considered satisfied only if
GetDependencyStatus(ScyllaDependencyInfo) returns Installed;
VersionMismatch or Unknown
are treated as not installed.
FromRuntimeData(ScyllaDependencyInfoData)
Converts a runtime ScyllaDependencyInfoData struct into an editor-side ScyllaDependencyInfo instance by mapping the numeric SourceType code to the corresponding DependencySourceType enum value.
Declaration
public static ScyllaDependencyInfo FromRuntimeData(ScyllaDependencyInfoData data)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaDependencyInfoData | data | The runtime dependency data struct to convert. Typically returned from GetDependencies(). |
Returns
| Type | Description |
|---|---|
| ScyllaDependencyInfo | A new ScyllaDependencyInfo populated with all fields from
|
Remarks
Source type mapping: 0 → UPMPackage,
1 → AssetStorePackage,
2 → ThirdParty,
3 → ScyllaModule. Unrecognized codes
fall back to ThirdParty.
GetAllDependencyStatuses(IEnumerable<ScyllaDependencyInfo>)
Determines the installation status of every dependency in the provided sequence and returns a new list containing updated ScyllaDependencyInfo instances. Internally delegates to GetDependencyStatus(ScyllaDependencyInfo) for each entry.
Declaration
public List<ScyllaDependencyInfo> GetAllDependencyStatuses(IEnumerable<ScyllaDependencyInfo> dependencies)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ScyllaDependencyInfo> | dependencies | The collection of dependencies to evaluate. Must not be |
Returns
| Type | Description |
|---|---|
| List<ScyllaDependencyInfo> | A new List<T> of ScyllaDependencyInfo instances, one per input entry, each reflecting the current detection result. |
GetDependencyStatus(ScyllaDependencyInfo)
Determines the current installation status of a single dependency and returns a new ScyllaDependencyInfo instance with the Status and InstalledVersion fields updated to reflect the current project state.
Declaration
public ScyllaDependencyInfo GetDependencyStatus(ScyllaDependencyInfo dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaDependencyInfo | dependency | The dependency whose status is to be determined. May be |
Returns
| Type | Description |
|---|---|
| ScyllaDependencyInfo | A new ScyllaDependencyInfo copy with updated |
Remarks
Detection strategy is selected based on SourceType:
- UPMPackage - looks up the package in the cached InstalledPackages dictionary, with an optional type-name fallback for packages that may be bundled under a different ID.
- AssetStorePackage and ThirdParty - uses reflection to check whether DetectionTypeName exists in any loaded assembly.
- ScyllaModule - enumerates all IScyllaDependencyProvider implementations to locate the matching module.
Returns null when dependency is null.
GetMissingRequiredCount(IEnumerable<ScyllaDependencyInfo>)
Counts the number of required dependencies in the provided sequence that are not currently installed with a passing status. Optional dependencies are not counted.
Declaration
public int GetMissingRequiredCount(IEnumerable<ScyllaDependencyInfo> dependencies)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<ScyllaDependencyInfo> | dependencies | The collection of dependencies to evaluate. Must not be |
Returns
| Type | Description |
|---|---|
| int | The number of required dependencies that are not installed. Returns |
Remarks
Internally calls GetDependencyStatus(ScyllaDependencyInfo) for each required dependency. A dependency is counted as missing if its status is anything other than Installed.
InstallUPMPackage(string, Action<bool, string>)
Initiates an asynchronous UPM package installation using the Unity Package Manager API. Only one installation can be in progress at a time; concurrent install requests are rejected via the callback.
Declaration
public void InstallUPMPackage(string packageID, Action<bool, string> onComplete = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | packageID | The UPM package identifier to install (e.g., |
| Action<bool, string> | onComplete | Optional callback invoked on the main thread when the installation finishes.
The first argument is |
Remarks
After a successful installation, RefreshInstalledPackages(Action) is called
automatically so that subsequent status queries reflect the newly installed package.
Progress polling is performed via EditorApplication.update on the Unity main thread.
InstallUPMPackages(string[], Action<bool, string>)
Initiates an asynchronous installation of multiple UPM packages in a single request
via Client.AddAndRemove. Use this to install all of a component's missing
packages at once instead of chaining individual InstallUPMPackage(string, Action<bool, string>) calls.
Declaration
public void InstallUPMPackages(string[] packageIDs, Action<bool, string> onComplete = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | packageIDs | The UPM package identifiers to install. |
| Action<bool, string> | onComplete | Optional callback invoked on the main thread when the installation finishes:
|
Remarks
Only one installation can be in progress at a time; concurrent requests are rejected
via the callback. After a successful installation, RefreshInstalledPackages(Action)
is called automatically. If packageIDs is null or empty, the callback
is invoked immediately with success.
OpenDocumentationURL(ScyllaDependencyInfo)
Opens the documentation URL of a dependency in the system's default web browser.
Declaration
public void OpenDocumentationURL(ScyllaDependencyInfo dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaDependencyInfo | dependency | The dependency whose documentation URL should be opened. May be |
Remarks
Does nothing if dependency is null or if
DocumentationURL is null or empty.
OpenInstallURL(ScyllaDependencyInfo)
Opens the install URL of a dependency in the system's default web browser. For Asset Store packages this navigates to the product page; for third-party packages it navigates to the download or repository URL.
Declaration
public void OpenInstallURL(ScyllaDependencyInfo dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| ScyllaDependencyInfo | dependency | The dependency whose install URL should be opened. May be |
Remarks
Does nothing if dependency is null or if
InstallURL is null or empty.
UPM packages typically have no install URL and are installed programmatically
via InstallUPMPackage(string, Action<bool, string>) instead.
RefreshInstalledPackages(Action)
Initiates an asynchronous refresh of the installed UPM package list by querying
the Unity Package Manager. Results are cached in InstalledPackages
and the optional onComplete callback is invoked on the main
thread once the query finishes.
Declaration
public void RefreshInstalledPackages(Action onComplete = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | onComplete | Optional callback invoked on the main thread after the package list has been
successfully populated or the request has failed. May be |
Remarks
If a refresh is already in progress (IsRefreshing is true)
the call is silently ignored and onComplete will not be invoked.
Progress polling is performed via EditorApplication.update and is therefore
constrained to the Unity main thread.