Skip to content

Game.Prefabs.DefaultPolicyInfo

Assembly: Assembly-CSharp (game code)
Namespace: Game.Prefabs

Type: class

Base: System.Object

Summary:
A simple serializable data container used by the game's prefab data to reference a default policy prefab. Instances of this class are typically embedded in other prefab definitions (for example, building or district prefabs) to indicate which PolicyPrefab should be considered the default for that prefab. The [Serializable] attribute allows Unity (and the game's serialization system) to include this object in saved data and prefab assets.


Fields

  • public PolicyPrefab m_Policy
    Holds a reference to the PolicyPrefab that is the default for the associated prefab. This field is public and serialized; it may be null if no default policy is set. PolicyPrefab is a game-specific type representing a policy asset (e.g., district or service policies).

  • private System.Diagnostics.Stopwatch m_Stopwatch
    {{ YOUR_INFO }}

  • private Unity.Jobs.JobHandle <producerHandle>k__BackingField
    {{ YOUR_INFO }}

Properties

  • public Unity.Jobs.JobHandle producerHandle { get; private set }
    {{ YOUR_INFO }}

Constructors

  • public DefaultPolicyInfo()
    Default parameterless constructor generated by the compiler. Creates an instance with m_Policy set to null by default.

Methods

  • protected virtual OnCreate() : System.Void
    {{ YOUR_INFO }}

Usage Example

// create and assign a default policy reference
var defaultPolicyInfo = new Game.Prefabs.DefaultPolicyInfo();
defaultPolicyInfo.m_Policy = somePolicyPrefab; // somePolicyPrefab is an instance of PolicyPrefab

// example of finding a policy prefab by name (game API may vary)
var policy = PrefabCollection<PolicyPrefab>.FindLoaded("MyPolicyPrefab");
defaultPolicyInfo.m_Policy = policy;

Notes: - The exact ways to obtain a PolicyPrefab instance depend on the game's prefab API (e.g., PrefabCollection, PrefabManager, or loading from assets).
- This type is intended as a lightweight data holder; behavior related to applying or activating the policy is handled elsewhere in the game's code.