Author Topic: ETA on Databinding  (Read 4712 times)

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
ETA on Databinding
« on: March 25, 2014, 04:48:58 AM »
Is there an ETA on Databinding?

Cheers.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ETA on Databinding
« Reply #1 on: March 26, 2014, 02:11:40 AM »
Soon™

P.S. "NData" addon added data binding support to NGUI years ago.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: ETA on Databinding
« Reply #2 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 ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ETA on Databinding
« Reply #3 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.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ETA on Databinding
« Reply #4 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.

wallabie

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 200
    • View Profile
Re: ETA on Databinding
« Reply #5 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.

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Re: ETA on Databinding
« Reply #6 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 ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ETA on Databinding
« Reply #7 on: May 18, 2014, 11:22:10 PM »
Property binding works only with components due to how Unity's serialization works.

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Re: ETA on Databinding
« Reply #8 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 ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ETA on Databinding
« Reply #9 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.

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Re: ETA on Databinding
« Reply #10 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.

chenmark

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: ETA on Databinding
« Reply #11 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.

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Re: ETA on Databinding
« Reply #12 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 ?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ETA on Databinding
« Reply #13 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.