Game.Prefabs.UpkeepModifierInfo
Assembly: Assembly-CSharp
Namespace: Game.Prefabs
Type: class
Base: System.Object
Summary:
A small serializable data container used to define an upkeep modifier for a specific resource in editor/prefab data. Instances pair a resource (Game.Economy.ResourceInEditor) with a multiplier that is applied to upkeep calculations for that resource. This class is marked [Serializable] so it can be serialized by Unity (e.g., stored on prefabs or editable in the inspector).
Fields
-
public Game.Economy.ResourceInEditor m_Resource
Holds a reference/identifier to the resource this modifier applies to. The exact type is Game.Economy.ResourceInEditor, which typically represents a resource entry visible/usable in editor or prefab definitions. -
public float m_Multiplier
Multiplier applied to the upkeep for the specified resource. Common usage: 1.0 = no change, values < 1.0 reduce upkeep, values > 1.0 increase upkeep. Note: if not explicitly initialized in code, the default value for a float in C# is 0.0f; however in practice one usually sets this to a meaningful value (e.g., 1.0f) when creating the modifier.
Properties
- This type declares no properties. It exposes two public fields (m_Resource and m_Multiplier) for direct access.
Constructors
public UpkeepModifierInfo()
Implicit parameterless constructor provided by the runtime. It initializes reference fields to null and numeric fields to their default values (m_Resource = null, m_Multiplier = 0.0f) unless Unity's serialization provides different values from asset data.
Methods
- This type declares no methods.
Usage Example
// Example: create and configure an upkeep modifier for a resource
var modifier = new UpkeepModifierInfo
{
m_Resource = someResourceInEditor, // Game.Economy.ResourceInEditor instance
m_Multiplier = 0.75f // reduce upkeep to 75% for this resource
};
// Typical usage: attach to a prefab's list of upkeep modifiers so the building's upkeep
// calculations incorporate this multiplier for the specified resource.