I’ve already found some solutions online for this, but they don’t seem to work for audioclips. Heres what I’m trying to do.
private static AudioClip instance;
public static AudioClip Instance
{
get { return instance; }
}
private void Awake()
{
// If no Player ever existed, we are it.
if (instance == null)
instance = this;
// If one already exist, it's because it came from another level.
else if (instance != this)
{
Destroy(gameObject);
return;
}
}
}
this is my first time adding audio, so i’m having a hard time.