title: Unity 3d Change Texture after Build
body: <p>I have a script attached to a Gameobject. I have also a button. When the button is pressed the file explorer opens and allow to select a custom image from PC and after importing original texture of Gameobject changes. But when I exit and run again then the custom texture replaces with original one. I want to save a custom texture instead of original texand then an option to delete the custom and go back to original tex. Please help me in this. Sorry for my bad english. This is my code:</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  using UnityEditor;
  using System.IO;
  
  
  public class ChangeTex : MonoBehaviour 
  
  {
      string path;
      public MeshRenderer mRenderer;
  
      public void OpenExplorer()
      {
          path = EditorUtility.OpenFilePanel("Overwrite with png", "", "png");
          GetImage();
      }
  
      void GetImage()
      {
          if (path != null)
          {
              UpdateImage();
          }
      }
      void UpdateImage()
      {
          byte[] imgByte = File.ReadAllBytes(path);
          Texture2D texture = new Texture2D (2, 2);
          texture.LoadImage(imgByte);
  
          mRenderer.material.mainTexture = texture;
  
      }
  
  }
  </code></pre>