Skip to content

RequiresField

wwwDayDream edited this page May 9, 2024 · 2 revisions

CessilCellsCeaChells.CeaChore Namespace

RequiresFieldAttribute

This attribute is used to specify that your plugin requires a specific field to be present (and so we will create it).

Usage: This attribute can be applied multiple times to an assembly.

Parameters:

  • targetType (Type): The type to inject the field onto.
  • fieldName (string): The name of the required field.
  • fieldType (Type): The type of the required field.

Example:

[assembly: RequiresField(typeof(Player), "exampleField", typeof(float))]

Creates

private float exampleField;