AssetList filter "LayerName" has unique implicit behavior not documented well

Issue #17 resolved
Deniz Ozkaynak created an issue

Was experimenting with filters and couldn't understand why LayerName wasn't producing the lists I expected. I realized this issue when I saw this example in the docs:

// Lists all prefabs with the layer name 'MyLayerName' and a MyComponent attached.
[AssetList(LayerName = "MyLayerName")]
public List MyPrefabs;

It's unclear why the LayerName filter implicitly applies the requirement that a "MyComponent" be attached; no other filters do this to my knowledge. Furthermore this requirement isn't explicitly documented anywhere except in the example code.

I'd prefer the underlying behavior be changed, but if that's not possible or goes against a design choice by the devs, please specify in the Properties documentation not just via example.

Comments (3)

  1. mSkull001
    • changed status to open

    Ah. This is actually an issue with our current documentation exporter. It doesn't handle generics very well. This example supposed look like this:

    // Lists all prefabs with the layer name 'MyLayerName' and a MyComponent attached.
    [AssetList(LayerName = "MyLayerName")]
    public List<MyComponent> MyPrefabs;

    As you can see the list is actually a type of List<MyComponent>, and that's why the AssetList will only find prefabs with a MyComponent attached. You can also make a list, or an array, of game objects, other components, and even assets such as textures, or meshes. We will be sure to have these documentation issue worked out before release. I will leave this issue as open, until it has been resolved. Sorry for the inconvience.

    I've also taken a look at your issue with LayerName, but I'm seeing exactly what I'm expecting. Could you futher clarify why your results, are not what you're expecting?

  2. Deniz Ozkaynak reporter

    Ah that makes way more sense, thanks for the speedy fix.

    As far as your previous question, this was the issue about LayerName; assuming you meant AssetList/SceneObjectsOnly, I had misunderstood the capabilities of AssetList. @Bjarkeck clarified everything for me.

  3. Log in to comment