private bool IsOptimized() { foreach (var oTarget in serializedObject.targetObjects) { var myTarget = oTarget as BbSprite; Debug.Assert(myTarget != null, "myTarget != null"); if (!TextureSettings.IsAtlasOptimalForBbSprite(myTarget.Atlas)) { return(false); } } return(true); }