Skip to content

Game.Prefabs.ToolUXSoundSettingsPrefab

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: class

Base: PrefabBase

Summary:
Prefab component that holds references to many tool/UI-related sound prefabs. During LateInitialize it converts the stored PrefabBase references into Entity handles (via PrefabSystem) and writes them into a ToolUXSoundSettingsData component on the prefab entity. This allows runtime systems to read sound Entity references from the ECS world instead of Unity objects.


Fields

  • public PrefabBase m_PolygonToolSelectPointSound
    Reference to the sound prefab played when selecting a polygon tool point.

  • public PrefabBase m_PolygonToolDropPointSound
    Reference to the sound prefab played when dropping a polygon tool point.

  • public PrefabBase m_PolygonToolRemovePointSound
    Reference to the sound prefab played when removing a polygon tool point.

  • public PrefabBase m_PolygonToolDeleteAreaSound
    Reference to the sound prefab played when deleting an area with the polygon tool.

  • public PrefabBase m_PolygonToolFinishAreaSound
    Reference to the sound prefab played when finishing a polygon area.

  • public PrefabBase m_BulldozeSound
    Reference to the bulldoze action sound prefab.

  • public PrefabBase m_PropPlantBulldozeSound
    Reference to the sound for bulldozing planted props.

  • public PrefabBase m_TerraformSound
    Reference to the terraform tool sound prefab.

  • public PrefabBase m_PlaceBuildingSound
    Reference to the sound played when placing a building.

  • public PrefabBase m_RelocateBuildingSound
    Reference to the sound played when relocating a building.

  • public PrefabBase m_PlaceUpgradeSound
    Reference to the sound played when placing an upgrade.

  • public PrefabBase m_PlacePropSound
    Reference to the sound played when placing a prop.

  • public PrefabBase m_PlaceBuildingFailSound
    Reference to the sound played when placing a building fails.

  • public PrefabBase m_ZoningFillSound
    Reference to the sound for zoning fill (paint) actions.

  • public PrefabBase m_ZoningRemoveFillSound
    Reference to the sound for removing zoning fill.

  • public PrefabBase m_ZoningStartPaintSound
    Reference to the sound played when starting zoning paint.

  • public PrefabBase m_ZoningEndPaintSound
    Reference to the sound played when ending zoning paint.

  • public PrefabBase m_ZoningStartRemovePaintSound
    Reference to the sound played when starting zoning remove paint.

  • public PrefabBase m_ZoningEndRemovePaintSound
    Reference to the sound played when ending zoning remove paint.

  • public PrefabBase m_ZoningMarqueeStartSound
    Reference to the sound when starting a zoning marquee selection.

  • public PrefabBase m_ZoningMarqueeEndSound
    Reference to the sound when ending a zoning marquee selection.

  • public PrefabBase m_ZoningMarqueeClearStartSound
    Reference to the sound when starting a marquee clear operation.

  • public PrefabBase m_ZoningMarqueeClearEndSound
    Reference to the sound when finishing a marquee clear.

  • public PrefabBase m_SelectEntitySound
    Reference to the sound played when selecting an entity.

  • public PrefabBase m_SnapSound
    Reference to the snapping sound used by tools.

  • public PrefabBase m_NetExpandSound
    Reference to the sound when expanding a network (roads/rails).

  • public PrefabBase m_NetStartSound
    Reference to the sound when starting to build a network.

  • public PrefabBase m_NetNodeSound
    Reference to the sound when creating a network node.

  • public PrefabBase m_NetBuildSound
    Reference to the sound while building a network segment.

  • public PrefabBase m_NetCancelSound
    Reference to the sound when cancelling a network build.

  • public PrefabBase m_NetElevationUpSound
    Reference to the sound when increasing network elevation.

  • public PrefabBase m_NetElevationDownSound
    Reference to the sound when decreasing network elevation.

  • public PrefabBase m_TransportLineCompleteSound
    Reference to the sound played when a transport line is completed.

  • public PrefabBase m_TransportLineStartSound
    Reference to the sound when starting a transport line.

  • public PrefabBase m_TransportLineBuildSound
    Reference to the sound when building transport line infrastructure.

  • public PrefabBase m_TransportLineRemoveSound
    Reference to the sound when removing a transport line.

  • public PrefabBase m_AreaMarqueeStartSound
    Reference to the sound when starting an area marquee.

  • public PrefabBase m_AreaMarqueeEndSound
    Reference to the sound when ending an area marquee.

  • public PrefabBase m_AreaMarqueeClearStartSound
    Reference to the sound when starting an area marquee clear.

  • public PrefabBase m_AreaMarqueeClearEndSound
    Reference to the sound when finishing an area marquee clear.

  • public PrefabBase m_TutorialStartedSound
    Reference to the sound played when a tutorial starts.

  • public PrefabBase m_TutorialCompletedSound
    Reference to the sound played when a tutorial completes.

  • public PrefabBase m_CameraZoomInSound
    Reference to the camera zoom-in sound.

  • public PrefabBase m_CameraZoomOutSound
    Reference to the camera zoom-out sound.

  • public PrefabBase m_DeletetEntitySound
    Reference to the sound for deleting an entity (note: name typo kept from source).

Properties

  • (No public properties declared on this prefab class.)

Constructors

  • public ToolUXSoundSettingsPrefab()
    Default constructor (standard Unity/PrefabBase construction). No custom construction logic in this class.

Methods

  • public override void GetPrefabComponents(HashSet<ComponentType> components)
    Adds the runtime ECS component type required by this prefab to the provided set. Specifically adds ToolUXSoundSettingsData so that the prefab entity will include that component when instantiated.

  • public override void LateInitialize(EntityManager entityManager, Entity entity)
    Converts each stored PrefabBase reference into an Entity reference using PrefabSystem.GetEntity(...) and populates a ToolUXSoundSettingsData instance with those entity handles. The filled ToolUXSoundSettingsData is then written to the provided entity via entityManager.SetComponentData. This is where Unity object references are translated to ECS data for runtime use.

Usage Example

// The prefab itself already implements LateInitialize to convert PrefabBase references
// into ECS ToolUXSoundSettingsData. Typical usage is to read ToolUXSoundSettingsData
// from the entity in a system to play the correct sound entities.

public partial struct ToolUXSoundPlaybackSystem : ISystem
{
    public void OnUpdate(ref SystemState state)
    {
        // Assume there is exactly one settings entity; obtain its data:
        var query = state.EntityManager.CreateEntityQuery(typeof(ToolUXSoundSettingsData));
        if (query.IsEmptyIgnoreFilter) return;

        var settings = query.GetSingleton<ToolUXSoundSettingsData>();
        // Use settings.m_PlaceBuildingSound (an Entity) to spawn/play audio via the audio system
        // Example (pseudo):
        // AudioSystem.PlayOneShot(state.EntityManager, settings.m_PlaceBuildingSound, position, volume);
    }
}