Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Audio Resource#

  • Can Read

  • Cannot Write

Description#

A constant Audio Resource value

Code#

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

namespace VisualScript.Runtime
{
    [Get]

    [Inline(nameof(m_Value), typeof(AudioResource), false)]

    [Title("Audio Resource")]
    [Category("Audio Resource")]

    [Description("A constant Audio Resource value")]
    [Image(typeof(IconAudioClip), ColorTheme.Type.Yellow)]

    [Keywords("Value", "Constant", "Clip")]

    [Serializable]
    public class TypeAudioResourceConstant : TypeAudioResource
    {
        [SerializeField] private AudioResource m_Value;

        public override AudioResource GetPreview(GameObject source) => this.m_Value;

        public TypeAudioResourceConstant() : this(null)
        { }

        public TypeAudioResourceConstant(AudioResource value)
        {
            this.m_Value = value;
        }

        public override AudioResource Get(Args args)
        {
            return this.m_Value;
        }

        public override string ToString() => TextUtils.Name(this.m_Value);

        protected override SubscriptionMode Subscription => SubscriptionMode.OnEditorChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.