Game.ServiceUpkeepItem
Assembly:
Assembly-CSharp (managed game assembly; the class is part of the game's runtime code)
Namespace: Game.Prefabs
Type:
Class
Base:
System.Object
Summary:
A small serializable data container used to describe upkeep-related data for a service prefab. Typically serialized with prefab data and used by the game/editor to store which resources are consumed as upkeep and whether those upkeep costs scale with usage. This class contains no behavior—only simple fields that are read/written by the game or editor tooling.
Fields
-
public ResourceStackInEditor m_Resources
Holds the resource stack that represents the upkeep cost(s) for the service in editor-friendly form. ResourceStackInEditor is a game/editor-specific type that groups one or more resource types and their quantities for display/serialization in prefab editing workflows. -
public bool m_ScaleWithUsage
When true, the upkeep amount described in m_Resources should be scaled according to the service's usage (for example, number of users, capacity, or activity). When false, the listed upkeep is treated as a flat/static cost.
Properties
- This class exposes no C# properties; it uses public fields for serialization and simple data access.
Constructors
public ServiceUpkeepItem()
Implicit parameterless constructor. As a POCO marked with [Serializable], instances are typically created by the game's serializer or by mod code when constructing/modifying prefab data.
Methods
- This class defines no methods; it is purely a data holder.
Usage Example
// Create and configure a ServiceUpkeepItem for use in a prefab or editor UI
var upkeep = new Game.Prefabs.ServiceUpkeepItem();
// Example: assign a ResourceStackInEditor (constructor/usage depends on that type's API)
upkeep.m_Resources = new ResourceStackInEditor(/* resource entries here */);
// Toggle whether upkeep scales with usage
upkeep.m_ScaleWithUsage = true;
// The instance can then be assigned to a prefab's data structure or serialized by the game's editor.
Notes: - The class is marked [Serializable], so it is intended to be serialized by Unity/.NET serializers used by the game. - ResourceStackInEditor is an engine/editor-specific type; consult its documentation or source to construct resource entries correctly.