private float getAudioLength(string name, string type) { if (type.Equals("SFX")) { return(audioLibrary.GetSFXClip(name).clip.length); } else if (type.Equals("BGM")) { return(audioLibrary.GetBGMClip(name).clip.length); } else { return(-1); } }
private void playSFX(string musicName) { sfxSource.PlayOneShot(audioLibrary.GetSFXClip(musicName)); }