Skip to content
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

Image Binder #10

Open
Avatarchik opened this issue Feb 21, 2018 · 2 comments
Open

Image Binder #10

Avatarchik opened this issue Feb 21, 2018 · 2 comments

Comments

@Avatarchik
Copy link

Hello! Thanks for the project, is there a possibility of binding a picture or for the next it is necessary to write your adapter? Is there still an option to make a list with a pool of objects so as not to load everything into the UI and load it like that?

@RoryDungan
Copy link
Contributor

In the past I've done this by exposing a property of type Texture on my view model and binding to it directly.

I like the idea of being able to have an adapter that takes something like a string and loads a texture from resources based on the string identifier though. Adapters are quite simple to write if you want to try this yourself. Have a look at the existing ones in UnityWeld/Binding/Adapters/ for some examples.

Resource pooling is a good idea but you would need to implement your own class for managing that. Managing pools of objects is probably outside the scope of this library.

@RoryDungan
Copy link
Contributor

RoryDungan commented Feb 22, 2018

Sorry I should have specified, when I did this I used a RawImage component and a one way property binding to bind its texture property to a property on my view model.

image

If you wanted to use an adapter you would have to create something like a StringToTexture2DAdapter that calls Resources.Load in its Convert function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants