List<Texture> GetSelectedTextures ()
{
List
<Texture
> textures
= new List
<Texture
>();
if (Selection.objects != null && Selection.objects.Length > 0)
{
List
<Object> selectedObjects
= new List
<Object>();
for (int i = 0; i < Selection.objects.Length; i++)
{
if (!System.IO.Path.GetExtension(AssetDatabase.GetAssetPath(Selection.objects[i])).Equals(".unity"))
{
selectedObjects.Add(Selection.objects[i]);
}
}
Object[] objects = EditorUtility.CollectDependencies(selectedObjects.ToArray());
foreach (Object o in objects)
{
Texture tex = o as Texture;
if (tex != null && (NGUISettings.atlas == null || NGUISettings.atlas.texture != tex)) textures.Add(tex);
}
}
return textures;
}