r2mods/ilspy_dump/ror2_csproj/RoR2/LoopSound.cs

28 lines
427 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
namespace RoR2;
public class LoopSound : MonoBehaviour
{
public string akSoundString;
public float repeatInterval;
public Transform soundOwner;
private float stopwatch;
private void Update()
{
stopwatch += Time.deltaTime;
if (stopwatch > repeatInterval)
{
stopwatch -= repeatInterval;
if ((bool)soundOwner)
{
Util.PlaySound(akSoundString, soundOwner.gameObject);
}
}
}
}