19 lines
339 B
C#
19 lines
339 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class AudioStreamPlayer2d : AudioStreamPlayer2D
|
|
{
|
|
|
|
[Export] AudioStream audio;
|
|
|
|
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
public override void _Process(double delta)
|
|
{
|
|
if (this.HasStreamPlayback() == false)
|
|
{
|
|
this.Stream = audio;
|
|
Play();
|
|
}
|
|
}
|
|
}
|