title: error CS0103: The name 'AssetPreview' does not exist in the current context
body: <p>In my Unity Project I've C# code to get Prefabs preview image in png format.</p>
  
  <p>In Unity Play mode I have not errors with this Script and everything it's ok, but when I trie to build my project I've receive error.</p>
  
  <p>I spend a lot of times to try understand where I'd made a mistake, but no result.</p>
  
  <p>Can some body help with this problem?</p>
  
  <p>C# Script</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  using System.IO;
  using System;
  
  public class LoadTexture : MonoBehaviour
  {
      [System.Serializable]
      public class LoadTex
      {
          public string name;
          public GameObject texture;
          public Texture2D gameObjectTex;
          public Texture gameObjTex;
      }
  
      public List&lt;LoadTex&gt; ItemTablezz = new List&lt;LoadTex&gt;();
  
      // Start is called before the first frame update
      void Start()
      {
          for (int i = 0; i &lt; ItemTablezz.Count; i++)
          {
              var getImage = UnityEditor.AssetPreview.GetAssetPreview(ItemTablezz[i].texture);
              print(getImage);
  
              ItemTablezz[i].gameObjectTex = getImage;
          }
      }
  
      // Update is called once per frame
      void Update()
      {
          CheckIfNull();
      }
  
      void CheckIfNull()
      {
          for (int k = 0; k &lt; ItemTablezz.Count; k++)
          {
              Texture2D tex = new Texture2D(128, 128, TextureFormat.RGBA32, false);
              Color[] colors = ItemTablezz[k].gameObjectTex.GetPixels();
              int i = 0;
              Color alpha = colors[i];
              for (; i &lt; colors.Length; i++)
              {
                  if (colors[i] == alpha)
                  {
                      colors[i].a = 0;
                  }
              }
  
              tex.SetPixels(colors);
              tex.Apply();
              byte[] png = tex.EncodeToPNG();
              File.WriteAllBytes(Application.persistentDataPath + "/" + ItemTablezz[k].name + ".png", png);
          }
      }
  }
  </code></pre>
  
  <blockquote>
    <p>error CS0103: The name 'AssetPreview' does not exist in the current context</p>
  </blockquote>
  
  <p>Where I'd made mistake?</p>