Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: wallabie on March 25, 2014, 04:48:58 AM

Title: ETA on Databinding
Post by: wallabie on March 25, 2014, 04:48:58 AM
Is there an ETA on Databinding?

Cheers.
Title: Re: ETA on Databinding
Post by: ArenMook on March 26, 2014, 02:11:40 AM
Soon™

P.S. "NData" addon added data binding support to NGUI years ago.
Title: Re: ETA on Databinding
Post by: wallabie on March 26, 2014, 04:28:11 AM
Great,

NData is Ok, but it is less than optimal, in the case of DaikonForge, the databinding doesn't require all of the boiler plate code.

Will the new databinding require boiler plate codes or more like Daikon ?
Title: Re: ETA on Databinding
Post by: ArenMook on March 26, 2014, 07:10:27 PM
It's a generic system. Bind anything to anything. Not GUI-related at all, much like the EventDelegate.
Title: Re: ETA on Databinding
Post by: ArenMook on March 27, 2014, 05:55:32 AM
FYI: Pro users can currently play with the data binding system. It's pretty much ready, so you will see it in 3.5.6.
Title: Re: ETA on Databinding
Post by: wallabie on March 29, 2014, 04:03:13 AM
Awesome.  Can't wait to give it a spin.  Been waiting a long time for this one.
Title: Re: ETA on Databinding
Post by: lzt120 on May 18, 2014, 10:01:16 PM
Can this binding system bind to one None-MonoBehaviour ?
For example:

public class Data
{
public string userName = "userName";
public int health = 100;
public int maxHealth = 100;
}

How can I bind this data to one label's text to show up userName and another sprite's fillAmount  to show up health / maxHealth ?
Title: Re: ETA on Databinding
Post by: ArenMook on May 18, 2014, 11:22:10 PM
Property binding works only with components due to how Unity's serialization works.
Title: Re: ETA on Databinding
Post by: lzt120 on May 20, 2014, 08:24:57 PM
I wonder if the binding system there are more other features (such as binding to Non-Mono behavior) are coming or It is the final release ?
Title: Re: ETA on Databinding
Post by: ArenMook on May 20, 2014, 10:42:08 PM
Nothing is ever in a "final" release with NGUI. It's always evolving. But I am happy with how it is right now. Whether I will be happy next week, who knows.
Title: Re: ETA on Databinding
Post by: lzt120 on May 21, 2014, 12:48:50 AM
In MMO Game, there are a lot of data class is Non-mono behavior, if the binding system can not handle this, there must be duplicate data need which is not allow, especially for mobile game. That's why I concern the binding system so much. If I use the Ndata, there are lots for code need rewrite as it support the property only.
Title: Re: ETA on Databinding
Post by: chenmark on May 21, 2014, 01:25:37 AM
If you know your way in coding, you can very easily implement a MonoBehaviour to proxy data from/to native data classes.
If you have lots of data providers your app is listening to at the same time, a better approach is to delegate events instead of polling values blindly.
If you already have a messaging system implemented you're almost there, just need to wrap up listeners in your MonoB proxy class and set your data providers to broadcast data  upon a change.
Title: Re: ETA on Databinding
Post by: lzt120 on June 22, 2014, 02:31:42 AM
1. Please if you can help for providing one example for this.
2. After using the data binding,I wonder if this will cost performance a lot ? I wonder if by declaring widget  class in my class and assign it by inspector will be more performance friendly ?
Title: Re: ETA on Databinding
Post by: ArenMook on June 22, 2014, 10:52:03 PM
Data binding is a lot more expensive than calling the method directly. It can be 100 times slower, as a matter of fact. Use it sparingly. It's for convenience, but you pay for this convenience.

To use this, add a public PropertyBinding member to your class. It will show up in inspector, letting you bind it to something.