お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Closeアセットのポストプロセッサーのバージョンを返します
スクリプトが再コンパイルされバージョンの変更が検出された場合、そのプロセッサーに関連付けられているアセットは再インポートされることになります スクリプトで行う処理をすべてのアセットに反映させる場合に使用します。
class TexturePostProcessor : AssetPostprocessor { // Bump this number to make textures reimport after modifying the post processor below. private uint m_Version = 0; public override uint GetVersion() {return m_Version;} public void OnPostprocessTexture(Texture2D tex) { Color[] pix = tex.GetPixels(); for (int i = 0; i < pix.Length; i++) { pix[i] = pix[i] * 0.5f; } tex.SetPixels(pix); tex.Apply(true, true); } }