public override Texture2D RenderStaticPreview(string assetPath, UnityEngine.Object[] subAssets, int width, int height) { SpriteAtlas spriteAtlas = AssetDatabase.LoadMainAssetAtPath(assetPath) as SpriteAtlas; Texture2D result; if (spriteAtlas == null) { result = null; } else { Texture2D[] previewTextures = spriteAtlas.GetPreviewTextures(); if (previewTextures == null || previewTextures.Length == 0) { result = null; } else { Texture2D texture2D = previewTextures[0]; PreviewHelpers.AdjustWidthAndHeightForStaticPreview(texture2D.width, texture2D.height, ref width, ref height); result = SpriteUtility.CreateTemporaryDuplicate(texture2D, width, height); } } return(result); }