On Audio Resource Change#
Bindings / On Audio Resource Change
Description#
Executes when the Audio Resource bound changes its value
Parameters#
| Name | Description |
|---|---|
| Initial Emit | Emits the event immediately when the component is enabled or not |
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Title("On Audio Resource Change")]
[Image(typeof(IconAudioClip), ColorTheme.Type.Yellow, typeof(BadgeLink))]
[Description("Executes when the Audio Resource bound changes its value")]
[Category("Bindings/On Audio Resource Change")]
[Serializable]
public class TriggerCoreBindAudioClip : TriggerCoreBindBase
{
[SerializeField] private GetAudioResource m_AudioResource = new GetAudioResource();
// PROPERTIES: ----------------------------------------------------------------------------
protected override string GetTitle(GameObject source) => $"change {this.m_AudioResource}";
protected override ISubscription Subscription => this.m_AudioResource;
}
}