AssetListAttribute.CustomFilterMethod should be a method of a UnityEngine.Object parameter.
Issue #90
resolved
consider the code:
[AssetList(CustomFilterMethod = "FilterTestObject")]
public UnityEngine.Object m_TestObject;
static bool FilterTestObject<T>(T obj) where T:UnityEngine.Object
{
var path = UnityEditor.AssetDatabase.GetAssetPath(obj);
if (path != null && path.EndsWith(".cs")) return true;
return false;
}
static bool FilterTestObject(UnityEngine.Object obj)
{
var path = UnityEditor.AssetDatabase.GetAssetPath(obj);
if (path != null && path.EndsWith(".cs")) return true;
return false;
}
The FilterTestObject
is not working intended.
Comments (5)
-
-
reporter - It doesnt filter Objects.
- If I choose something, it shows:
-
reporter Actually, I want a control to easily choose ".lua" file.
-
Ah i see whats the issue is now, sorry.
I'm on it.
-
- changed status to resolved
I did fix one more potential issue, but your problem is actually solved in the latest version available on the Asset Store. Just upgrade and everything should work you.
- Log in to comment
Could you clarify a bit what you mean? Just ran your example, and for me it works as currently intended. The CustomFilterMethod does not support methods with generic constraints, so it finds the second method from you example and uses that.