- Home /
Question by
Bas-Smit · Dec 23, 2012 at 09:30 PM ·
textureimporter
Initial importer settings appear corrupted.
When I import a png and run the following script it appears the textureimporter settings are set to some kind of default. After I change a setting and apply the value is correct. Can anyone confirm and or explain this?
Initial values:
wrapMode = -1
filterMode = -1
anisoLevel = -1
Script:
using System;
using UnityEditor;
using UnityEngine;
public class Test : EditorWindow
{
[MenuItem("Test/Test")]
static void MenuItem()
{
GetWindow<Test>();
}
void OnGUI()
{
if (GUILayout.Button("print"))
{
var i = (TextureImporter) AssetImporter.GetAtPath("Assets/image.png");
Debug.Log(i.wrapMode);
Debug.Log(i.filterMode);
Debug.Log(i.anisoLevel);
}
}
}
Comment