Audio Source Stop#
Audio / Audio Source / Audio Source Stop
Description#
Executes the Stop method on the Audio Source component
Code#
// <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 Stop")]
[Category("Audio/Audio Source/Stop")]
[Description("Executes the Stop method on the Audio Source component")]
[Image(typeof(IconAudioSource), ColorTheme.Type.Yellow)]
[Keywords("Audio, Sound, Music, Ambient, Sfx")]
[Serializable]
public class GenInstructionAudioSource_Stop_0 : Instruction
{
[SerializeField] private GetGameObject m_AudioSource = new GetGameObject(
new GenTypeGameObject_AudioSource()
);
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Stop");
return $"{this.m_AudioSource} {method}";
}
protected override Awaitable Run(Args args)
{
AudioSource component = this.m_AudioSource.Get<AudioSource>(args);
if (component == null) return Done;
component.Stop();
return Done;
}
}
}