Tanoda
TextureSteal.cs
Go to the documentation of this file.
1
using
System.Collections;
2
using
System.Collections.Generic;
3
using
UnityEngine
;
4
5
public
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
}
TextureSteal
Definition:
TextureSteal.cs:6
TextureSteal.exportTo
string exportTo
Definition:
TextureSteal.cs:7
UnityEngine
Definition:
HSVPicker/UtilityScripts/BoxSlider.cs:7
Source
Assets
Scripts
TestScripts
TextureSteal.cs
Generated by
1.9.3