Game.Economy.ResourceArrayAttribute
Assembly: Assembly-CSharp (game's runtime assembly)
Namespace: Game.Economy
Type: class
Base: System.Attribute
Summary: ResourceArrayAttribute is a simple marker attribute used to annotate methods, properties or fields that represent "resource arrays" within the game's codebase. The attribute itself carries no data or behavior; it serves as metadata for tooling, code generation, serialization, or editor systems to recognize and treat the annotated member as a resource array. It is declared with AttributeUsage limiting its targets to Method, Property, and Field (default attribute settings apply: AllowMultiple = false, Inherited = true).
Fields
- This class declares no instance or static fields. This attribute is empty and acts purely as a marker; there are no backing fields to configure behavior.
Properties
- This attribute exposes no properties. There are no configurable options on this attribute — it's parameterless.
Constructors
public ResourceArrayAttribute()
This is the implicit, parameterless constructor inherited from System.Attribute. The attribute provides no constructor overloads or parameters.
Methods
- This attribute defines no methods. There are no special lifecycle hooks or helper methods — it is purely metadata.
Usage Example
using Game.Economy;
// Apply to a field
[ResourceArray]
public int[] resourceAmounts;
// Apply to a property
[ResourceArray]
public Resource[] Resources { get; set; }
// Apply to a method (for example, a method that returns an array of resources)
[ResourceArray]
public Resource[] GetResources() { /* ... */ }
Notes and guidance: - The attribute is parameterless and functions only as a marker. How the game or modding tools respond to this marker depends on the surrounding tooling or runtime code that looks for it. - Valid targets: Method, Property, Field (as declared by AttributeUsage). - Default AttributeUsage behavior: AllowMultiple = false (you cannot apply it multiple times to the same member), Inherited = true (it will be inherited by derived classes when applied to a member that can be inherited). - Use this attribute when you want to indicate to the game/tooling that a particular array member represents resource data and should be processed accordingly by resource-aware systems.