AssetListAttribute.CustomFilterMethod should be a method of a UnityEngine.Object parameter.

Issue #90 resolved
y wq created an issue

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)

  1. Bjarke Elias

    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.

  2. Bjarke Elias

    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.

  3. Log in to comment