I have a button with this component in the scene:
public class BuyButton : MonoBehaviour
{
[SerializeField]
private Tower tower;
// ...
}
Tower looks like this:
public class Tower : MonoBehaviour
{
// ...
}
In the editor, when editing a button with BuyButton, this allows me to select objects having Tower components in the scene.
But for some reason the picker won’t show me objects having Tower from assets:
Why can’t assets be selected in this picker ? Is this a limitation of unity? how To bypass it ?
I could change the type to gameObject and then get the component in script but that feels rather cumbersome especially when it works properly with objets present in the scene