void RefreshPaletteImages(InstancePainter ip)
 {
     if (palleteImages == null || palleteImages.Length != ip.prefabPallete.Length)
     {
         palleteImages = new Texture2D[ip.prefabPallete.Length];
         for (var i = 0; i < ip.prefabPallete.Length; i++)
         {
             palleteImages[i] = AssetPreview.GetAssetPreview(ip.prefabPallete[i]);
         }
     }
 }
 void OnEnable()
 {
     stamp           = new GameObject("Stamp");
     stamp.hideFlags = HideFlags.HideAndDontSave;
     ip = target as InstancePainter;
     if (ip.SelectedPrefab != null)
     {
         variations = ip.SelectedPrefab.GetComponent <Variations>();
         if (variationsEditor != null)
         {
             DestroyImmediate(variationsEditor);
         }
         if (variations != null)
         {
             variationsEditor = Editor.CreateEditor(variations);
         }
         CreateNewStamp();
     }
 }