Tanoda
TextureSteal.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class TextureSteal : MonoBehaviour
6{
7 public string exportTo = "D:\\teszt.png";
8 [NaughtyAttributes.Button]
9 void Steal()
10 {
11 var mr = GetComponent<MeshRenderer>();
12 var mat = mr.material;
13 System.IO.File.WriteAllBytes(exportTo, ImageConversion.EncodeToPNG(mat.mainTexture as Texture2D));
14 }
15}
string exportTo
Definition: TextureSteal.cs:7