Страница 1 из 1

TexturePreprocessor: как узнать имя текстуры?

СообщениеДобавлено: 24 июл 2009, 13:44
gnoblin
Код: Выделить всё
using UnityEngine;
using UnityEditor;
using System.Collections;

public class TexturePreprocessor : AssetPostprocessor
{
   
    void OnPreprocessTexture()
    {
     
            TextureImporter textureImporter = assetImporter as TextureImporter;
            textureImporter.mipmapEnabled = false;
            textureImporter.textureFormat = TextureImporterFormat.ARGB16;
   if (assetPath.Contains("_32b"))
   {
    textureImporter.textureFormat = TextureImporterFormat.ARGB32;
   }
       
    }



}


вопрос: как подзырить имя импортируемой текстуры?

Re: TexturePreprocessor: как узнать имя текстуры?

СообщениеДобавлено: 24 июл 2009, 13:49
gnoblin
Как запостил - сразу допер).

assetImporter.assetPath

или

textureImporter.assetPath