public static void Create(string backupName, int terrainGroupId, List <GTerrainResourceFlag> flags) { List <GStylizedTerrain> terrains = new List <GStylizedTerrain>(GStylizedTerrain.ActiveTerrains); for (int i = 0; i < terrains.Count; ++i) { GStylizedTerrain t = terrains[i]; if (t.TerrainData == null) { continue; } if (terrainGroupId >= 0 && terrainGroupId != t.GroupId) { continue; } try { BackupTerrain(t, backupName, flags); } catch (System.Exception e) { Debug.LogError(string.Format("Error on creating backup for {0}: {1}", t.name, e.ToString())); } } GBackupFile.SetBackupCreationTime(backupName, System.DateTime.Now); GUndoCompatibleBuffer.Instance.CurrentBackupName = backupName; if (Changed != null) { Changed.Invoke(); } }
public static void Create(string backupName, GStylizedTerrain terrain, List <GTerrainResourceFlag> flags) { try { BackupTerrain(terrain, backupName, flags); } catch (System.Exception e) { Debug.LogError(string.Format("Error on creating backup for {0}: {1}", terrain.name, e.ToString())); } GBackupFile.SetBackupCreationTime(backupName, System.DateTime.Now); GUndoCompatibleBuffer.Instance.CurrentBackupName = backupName; if (Changed != null) { Changed.Invoke(); } }