private void DrawDataSaver(int index)
    {
        GameSaveCategory type = (GameSaveCategory)index;
        var saver             = saveManager.GetDataSaver(type);
        var newSaver          = EditorGUILayout.ObjectField(typeNames[index], saver, typeof(DataSaver), false) as DataSaver;

        if (newSaver != saver)
        {
            saveManager.SetDataSaver(type, newSaver);
            if (saveManager.gameObject.scene.name == null)
            {
                EditorUtility.SetDirty(saveManager);
            }
            else
            {
                EditorSceneManager.MarkSceneDirty(saveManager.gameObject.scene);
            }
        }
    }
 public DataSaver GetDataSaver(GameSaveCategory type)
 {
     return(dataSavers[(int)type]);
 }
 public void SetDataSaver(GameSaveCategory type, DataSaver newDataSaver)
 {
     dataSavers[(int)type] = newDataSaver;
 }