private bool MigrateGameObjectHierarchy(GameObject parent, MigrationStatus status) { bool changedAnyGameObject = false; foreach (var child in parent.GetComponentsInChildren <Transform>(true)) { try { if (migrationHandlerInstance.CanMigrate(child.gameObject)) { changedAnyGameObject = true; migrationHandlerInstance.Migrate(child.gameObject); status.AddToLog($"Successfully migrated {child.gameObject.name} object \n"); } } catch (Exception e) { status.Failures++; status.AddToLog($"{e.Message}: GameObject {child.gameObject.name} could not be migrated \n"); } } return(changedAnyGameObject); }
private void MigrateGameObjectHierarchy(GameObject parent) { foreach (var child in parent.GetComponentsInChildren <Transform>()) { try { if (migrationHandlerInstance.CanMigrate(child.gameObject)) { migrationHandlerInstance.Migrate(child.gameObject); Debug.Log($"Successfully migrated {parent.name} object"); } } catch (Exception e) { Debug.LogError($"{e.Message}: GameObject {parent.name} could not be migrated"); } } }