void SelectMusic() { if (selMusic == -1) { // Nothing selected if (soundType == 0) { musicValues.ResetValues(); } else { sfxValues.ResetValues(); } } else { // Something selected selMusic = Mathf.Min(currentEntryList.Length - 1, selMusic); if (soundType == 0) { MusicList me = (MusicList)musicLibrary.GetEntryByIndex(selMusic); musicValues.CopyValues(me); } else { SfxList se = (SfxList)sfxLibrary.GetEntryByIndex(selMusic); sfxValues.CopyValues(se); } } }
void SaveSelectedMusic() { if (soundType == 0) { MusicList me = (MusicList)musicLibrary.GetEntryByIndex(selMusic); me.CopyValues(musicValues); Undo.RecordObject(me, "Updated music list"); EditorUtility.SetDirty(me); } else { SfxList se = (SfxList)sfxLibrary.GetEntryByIndex(selMusic); se.CopyValues(sfxValues); Undo.RecordObject(se, "Updated sfx list"); EditorUtility.SetDirty(se); } }