Skip to content

BepInDependency Class

This attribute specifies any dependencies that this plugin has on other plugins.

C#
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class BepInDependency : Attribute, ICacheable

Inheritance objectAttribute

Implements ICacheable

Marks this BaseUnityPlugin as dependent on another plugin. The other plugin will be loaded before this one. If the other plugin doesn’t exist, what happens depends on the Flags parameter.

C#
public BepInDependency(string DependencyGUID, BepInDependency.DependencyFlags Flags = DependencyFlags.HardDependency)

DependencyGUID string
The GUID of the referenced plugin.

Flags BepInDependency.DependencyFlags
The flags associated with this dependency definition.

Marks this BaseUnityPlugin as dependent on another plugin. The other plugin will be loaded before this one. If the other plugin doesn’t exist or is of a version not satisfying VersionRange, this plugin will not load and an error will be logged instead.

C#
public BepInDependency(string guid, string version)

guid string
The GUID of the referenced plugin.

version string
The version range of the referenced plugin.

When version is supplied the dependency is always treated as HardDependency

The GUID of the referenced plugin.

C#
public string DependencyGUID { get; protected set; }

The flags associated with this dependency definition.

C#
public BepInDependency.DependencyFlags Flags { get; protected set; }

The version SemVer.Range of the referenced plugin.

C#
public Range VersionRange { get; protected set; }