public void DeleteFile() // This function deletes a scouting data file { notificationSystem.DeletedScoutingData(EventSystem.current.currentSelectedGameObject.transform.parent.name); // Debug.Log("Deleted: " + EventSystem.current.currentSelectedGameObject.transform.parent.name); File.Delete(Application.persistentDataPath + "/" + EventSystem.current.currentSelectedGameObject.transform.parent.name); Destroy(EventSystem.current.currentSelectedGameObject.transform.parent.gameObject); scoutingDataFiles.Remove(EventSystem.current.currentSelectedGameObject.transform.parent.name); }