Audio Source Time#
Audio / Audio Source / Audio Source Time
Description#
Compares the Time property of Audio Source component to another value
Parameters#
| Name | Description |
|---|---|
| Audio Source | |
| Compare | |
| Value |
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 Time")]
[Category("Audio/Audio Source/Time")]
[Description("Compares the Time property of Audio Source component to another value")]
[Image(typeof(IconAudioSource), ColorTheme.Type.Yellow)]
[Keywords("Audio, Sound, Music, Ambient, Sfx")]
[Parameter("Audio Source")]
[Parameter("Compare")]
[Parameter("Value")]
[Serializable]
public class GenConditionNumber_AudioSource_CheckTime : Condition
{
[SerializeField] private GetGameObject m_AudioSource = new GetGameObject(
new GenTypeGameObject_AudioSource()
);
[SerializeField] private CompareNumber m_Compare = new CompareNumber();
[SerializeField] private GetNumber m_Value = new GetNumber();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Time");
return $"{this.m_AudioSource} {member} {this.m_Compare} {this.m_Value}";
}
protected override bool Run(Args args)
{
AudioSource component = this.m_AudioSource.Get<AudioSource>(args);
if (component == null) return false;
return this.m_Compare.Compare(component.time, (float) this.m_Value.Get(args));
}
}
}