Skip to content

Game.Prefabs.ResourceProductionInfo

Assembly:
Assembly-CSharp

Namespace: Game.Prefabs

Type:
class

Base:
System.Object

Summary:
A small serializable data container used to describe how a prefab produces a particular resource. Instances of this class typically appear as part of a prefab or building data structure and are serialized by Unity (hence the [Serializable] attribute). It ties a resource identifier (ResourceInEditor) to simple numeric production parameters (rate and storage capacity).


Fields

  • public Game.Economy.ResourceInEditor m_Resource
    Identifies which resource this production info applies to. ResourceInEditor is a type defined in the Game.Economy namespace that represents a resource as shown/edited in the editor (for example a raw material, good, or service).

  • public int m_ProductionRate
    Numeric production rate for the resource. This integer is a simple scalar value describing how much of the resource the prefab produces (or is configured to produce). The exact time unit or conversion depends on the surrounding game/economy code that consumes this value.

  • public int m_StorageCapacity
    Storage capacity for the produced resource associated with this prefab. Represents how many units of the resource can be stored by the entity owning this production info.

Properties

This class does not declare any properties. It exposes three public fields and relies on serialization rather than property accessors.

Constructors

  • public ResourceProductionInfo()
    The default parameterless constructor is compiler-generated. Typical usage is to create an instance and assign fields directly (or to let Unity deserialize it when it is embedded in a serialized object).

Methods

This class does not declare any methods. It is a plain data container.

Usage Example

// Create and configure a ResourceProductionInfo instance (e.g., when constructing prefab data)
var prodInfo = new Game.Prefabs.ResourceProductionInfo();
prodInfo.m_Resource = new Game.Economy.ResourceInEditor(/* initialize as appropriate */);
prodInfo.m_ProductionRate = 10;     // set desired production rate
prodInfo.m_StorageCapacity = 200;   // set storage capacity

// When embedded in a prefab class that Unity serializes, the fields will be visible/editable in the inspector
// and read by game systems that evaluate production and storage.

Notes and modding tips: - Because this class is marked [Serializable] and uses public fields, it is intended for Unity serialization and will appear in the inspector when part of a serialized MonoBehaviour/ScriptableObject or prefab data structure. - For exact semantics (time unit for m_ProductionRate, interplay with other economy systems), inspect the code paths in the Game.Economy namespace that consume ResourceProductionInfo or reference ResourceInEditor.