public static bool IsSceneGroupHasMissingEntries(ManagerSceneGroupAsset group) { if (group == null) { throw new ArgumentNullException(nameof(group)); } for (int i = 0; i < group.Scenes.Count; i++) { ManagerSceneGroupAsset.Entry entry = group.Scenes[i]; if (!string.IsNullOrEmpty(entry.Id) && !string.IsNullOrEmpty(entry.Address)) { var asset = AssetDatabase.LoadAssetAtPath <Object>(entry.Address); if (asset == null) { return(true); } } else { return(true); } } return(false); }
public static void UpdateSceneGroupEntries(ManagerSceneGroupAsset group) { if (group == null) { throw new ArgumentNullException(nameof(group)); } for (int i = 0; i < group.Scenes.Count; i++) { ManagerSceneGroupAsset.Entry entry = group.Scenes[i]; if (!string.IsNullOrEmpty(entry.Id)) { string path = AssetDatabase.GUIDToAssetPath(entry.Id); if (!string.IsNullOrEmpty(path)) { entry.Address = path; group.Scenes[i] = entry; } } } }