diff options
Diffstat (limited to 'Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs')
-rw-r--r-- | Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs b/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs deleted file mode 100644 index f351635c..00000000 --- a/Assets/ThirdParty/Behavior Designer/Runtime/Basic Tasks/AudioSource/Stop.cs +++ /dev/null @@ -1,41 +0,0 @@ -using UnityEngine;
-
-namespace BehaviorDesigner.Runtime.Tasks.Basic.UnityAudioSource
-{
- [TaskCategory("Basic/AudioSource")]
- [TaskDescription("Stops playing the audio clip. Returns Success.")]
- public class Stop : Action
- {
- [Tooltip("The GameObject that the task operates on. If null the task GameObject is used.")]
- public SharedGameObject targetGameObject;
-
- private AudioSource audioSource;
- private GameObject prevGameObject;
-
- public override void OnStart()
- {
- var currentGameObject = GetDefaultGameObject(targetGameObject.Value);
- if (currentGameObject != prevGameObject) {
- audioSource = currentGameObject.GetComponent<AudioSource>();
- prevGameObject = currentGameObject;
- }
- }
-
- public override TaskStatus OnUpdate()
- {
- if (audioSource == null) {
- Debug.LogWarning("AudioSource is null");
- return TaskStatus.Failure;
- }
-
- audioSource.Stop();
-
- return TaskStatus.Success;
- }
-
- public override void OnReset()
- {
- targetGameObject = null;
- }
- }
-}
\ No newline at end of file |