Game.Prefabs.Effects.CitizenSelectedSoundInfo
Assembly: Game
Namespace: Game.Prefabs.Effects
Type: class
Base: System.Object
Summary:
Serializable data container used by effect prefabs to select a sound to play when a citizen is selected. Selection criteria include the citizen's age, optionally whether the citizen is sick or injured, and (when applicable) the citizen's happiness. The class is designed to be editable in the Unity inspector (Tooltips present on fields to guide designers).
Fields
-
public CitizenAge m_Age
Specifies the age group of the citizen this sound entry applies to (e.g., child, adult, senior). Used to match the selected citizen's age. -
public bool m_IsSickOrInjured
When true, indicates this entry applies to citizens who are sick or injured. If checked, the m_Happiness value is ignored (the Tooltip on the field clarifies this behavior). -
public CitizenHappiness m_Happiness
Specifies the happiness state required for this entry to match (e.g., happy, neutral, unhappy). This field is ignored when m_IsSickOrInjured is true. -
public EffectPrefab m_SelectedSound
Reference to the effect/sound prefab that should be played when a citizen matching the criteria is selected.
Properties
- None
Constructors
public CitizenSelectedSoundInfo()
Default parameterless constructor generated by the compiler. Typical usage is by direct instantiation or via Unity's serialization system (inspector).
Methods
- None
Usage Example
// Create and configure a selection entry in code
var soundInfo = new CitizenSelectedSoundInfo
{
m_Age = CitizenAge.Adult,
m_IsSickOrInjured = false,
m_Happiness = CitizenHappiness.Happy,
m_SelectedSound = myEffectPrefab // EffectPrefab reference set elsewhere
};
// When used by an effects system, this entry would be matched against the
// selected citizen's age, sickness state, and happiness to determine which
// sound to play.
Additional notes: - The class is marked [Serializable], so instances are intended to be edited/serialized by Unity (appear in the inspector). - Tooltips on m_IsSickOrInjured and m_Happiness guide designers: checking "Is Sick Or Injured" makes the happiness check irrelevant for that entry. - CitizenAge, CitizenHappiness and EffectPrefab are game-specific types/enums defined elsewhere in the codebase; ensure the referenced EffectPrefab points to a valid sound/effect asset.