UnityEditor.AudioClipInspector.RenderStaticPreview C# (CSharp) Method

RenderStaticPreview() public method

public RenderStaticPreview ( string assetPath, UnityEngine subAssets, int width, int height ) : Texture2D
assetPath string
subAssets UnityEngine
width int
height int
return UnityEngine.Texture2D
        public override Texture2D RenderStaticPreview(string assetPath, UnityEngine.Object[] subAssets, int width, int height)
        {
            AssetImporter atPath = AssetImporter.GetAtPath(assetPath);
            AudioImporter importer2 = atPath as AudioImporter;
            if (importer2 == null)
            {
                return null;
            }
            AudioClip target = this.target as AudioClip;
            Texture2D[] waveForms = new Texture2D[target.channels];
            for (int i = 0; i < target.channels; i++)
            {
                waveForms[i] = AudioUtil.GetWaveForm(target, atPath, i, (float) width, (float) (height / target.channels));
            }
            return CombineWaveForms(waveForms);
        }