Anyone knows how to use Resources.LoadAll or another method like this, in EditorWindow?
I have that error: LoadAll can only be called from the main thread.
Generaly I create node editor, where i need all items in my resources.
This is how I use my static method:
foreach (var item in DataManager.Items.All<Food>())
{
_foodItems.Add(item.Name);
}
This is my static method:
internal static IEnumerable<T> All<T>() where T : BaseItem
{
return Resources.LoadAll<T>(itemsPaths[typeof (T)]);
}
BaseItem is public abstract class with some public variables.
public abstract class BaseItem : Datablock
{
#region Data
/// <summary>
/// Game item name.
/// </summary>
public string Name;
Ohhh and QuestTaskNode class where I want use Resources.LoadAll inherits from ScriptableObject
