Skip to content

Game.Prefabs.FeeParameters

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType

Summary:
Serializable value-type that holds simple fee-related parameters used by prefabs (e.g., building or service definitions). Contains a default fee value, an upper bound, and a flag indicating whether the fee is adjustable. Fields are public and Unity-serializable.


Fields

  • public float m_Default
    Default fee value. Represents the base fee amount (in game units) or base multiplier depending on the consumer of this struct. When not explicitly initialized it defaults to 0.0f.

  • public float m_Max
    Maximum allowed fee. Used to clamp or validate fee changes; defaults to 0.0f if not set.

  • public bool m_Adjustable
    If true, the fee can be adjusted (by the player or game systems); if false, the fee is fixed.

Properties

  • This struct does not define any properties. It exposes three public fields for direct access and serialization.

Constructors

  • public FeeParameters()
    Implicit default constructor provided by C# for value types. Fields default to 0.0f for floats and false for bools. You can also initialize via object initializer syntax to set explicit values.

Methods

  • This struct does not define any methods.

Usage Example

// Initialize with explicit values
Game.Prefabs.FeeParameters fees = new Game.Prefabs.FeeParameters
{
    m_Default = 5.0f,   // base fee (game currency or multiplier)
    m_Max = 20.0f,      // upper limit
    m_Adjustable = true // allow adjustments
};

// Use in code that applies or validates fees
float appliedFee = Math.Min(fees.m_Default, fees.m_Max);
if (fees.m_Adjustable)
{
    // allow UI or gameplay to change the fee within [0, fees.m_Max]
}

Notes: - The [Serializable] attribute makes the struct Unity-serializable when used as a field on MonoBehaviours/ScriptableObjects or other serialized containers. - Because FeeParameters is a value type, assigning it copies the values; modify instances accordingly when used in collections or component data.