Audio Source Play On Gamepad#
Audio / Audio Source / Audio Source Play On Gamepad
Can Read
Cannot Write
Description#
Returns the execution of Play On Gamepad 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
{
[Get]
[Title("Audio Source Play On Gamepad")]
[Category("Audio/Audio Source/Play On Gamepad")]
[Description("Returns the execution of Play On Gamepad method on the Audio Source component")]
[Image(typeof(IconAudioSource), ColorTheme.Type.Yellow)]
[Keywords("Audio, Sound, Music, Ambient, Sfx")]
[Serializable]
public class GenTypeBool_AudioSource_PlayOnGamepad_1 : TypeBool
{
[SerializeField] private GetGameObject m_AudioSource = new GetGameObject(
new GenTypeGameObject_AudioSource()
);
[SerializeField] private GetInteger m_Slot = new GetInteger();
public override bool Get(Args args)
{
AudioSource component = this.m_AudioSource.Get<AudioSource>(args);
if (component == null) return default;
bool value = (bool) component.PlayOnGamepad(
(int) this.m_Slot.Get(args)
);
return value;
}
public override string ToString()
{
return $"{this.m_AudioSource} Play On Gamepad ({this.m_Slot})";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}