1. How could I custom save/load an AudioSource.clip? (remember currently playing music)
2. Should this script be outside the Plugins folder because it references a component?
3. Is it okay to use "new Awake" instead of override? (this script will be attached to the object containing the AudioSource)
Code: Select all
using UnityEngine;
namespace PixelCrushers
{
public class SaverTemplate : Saver
{
private AudioClip song;
private new void Awake()
{
song = GetComponent<AudioSource>().clip;
}
public override string RecordData()
{
SaveSystem.Serialize(song); //save obj to string
return string.Empty;
}
}