Skip to content

Clear error message when no bindable elements found. #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stilnat opened this issue Dec 2, 2024 · 0 comments
Open

Clear error message when no bindable elements found. #75

stilnat opened this issue Dec 2, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@stilnat
Copy link

stilnat commented Dec 2, 2024

Feature request

When creating a new view prefab, I made the mistake to put bindable elements on the root game object, and could not get anything to work. While going through the code I ended up seeing that bindable elements should be on child game objects only.

_bindableElements = RootElement
    .GetComponentsInChildren<IBindableElement>(true)
    .Where(element => ((MonoBehaviour) element).gameObject != RootElement)
    .ToList();

I suggest adding a debug message when the _bindableElements list has 0 elements such as :
"No bindable elements found, did you add bindable elements on children gameobjects of the Canvas view's Game object ?" Or something similar.

@stilnat stilnat added the enhancement New feature or request label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants