---
tags:
    - "Audio, Sound, Music, Ambient, Sfx"
---

# Audio Source Resource

[Audio](../index.md) / [Audio Source](index.md) / **Audio Source Resource**

## Description

Compares the Resource property of Audio Source component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Audio Source |  |
| Value |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Audio;

namespace VisualScript.Runtime
{
    [Title("Audio Source Resource")]
    [Category("Audio/Audio Source/Resource")]
    [Description("Compares the Resource property of Audio Source component to another value")]
    
    [Image(typeof(IconAudioSource), ColorTheme.Type.Yellow)]
    [Keywords("Audio, Sound, Music, Ambient, Sfx")]
    
    [Parameter("Audio Source")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionAudioResource_AudioSource_CheckResource : Condition
    {
        [SerializeField] private GetGameObject m_AudioSource = new GetGameObject(
            new GenTypeGameObject_AudioSource()
        );
        
        [SerializeField] private GetAudioResource m_Value = new GetAudioResource();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Resource");
            return $"{this.m_AudioSource} {member} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            AudioSource component = this.m_AudioSource.Get<AudioSource>(args);
            if (component == null) return false;
            
            return component.resource == this.m_Value.Get(args) as AudioResource;
        }
    }
}


```

