Unity3D2Babylon.SceneBuilder.GetPixels C# (CSharp) Method

GetPixels() private static method

private static GetPixels ( Texture2D texture ) : Color[]
texture UnityEngine.Texture2D
return Color[]
        private static Color[] GetPixels(Texture2D texture)
        {
            Color[] pixels = null;
            string srcTexturePath = AssetDatabase.GetAssetPath(texture);
            var importTool = new BabylonTextureImporter(srcTexturePath);
            bool isReadable = importTool.IsReadable();
            if (!isReadable) importTool.SetReadable();
            try
            {
                pixels = texture.GetPixels();
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
            finally
            {
                if (!isReadable) importTool.ForceUpdate();
            }
            return pixels;
        }