Unity3D has offered very handy interface to expose variables so that users can edit them in inspector. Take a look at below snapshot: one can define some public fields, and these fields are immediately seen in the inspector, once the script is attached tom some game object:
That is cool! But you might expect another feature: when the value changes, you get notified, and can hook your own action with it!
In C# and winform, it is trivial: SomVarTextBoxControl.TextChanged += YourAction(…)
Unfortunately, this kind of handy event handler does not exist in Unity3D! To get similar functionality, you need use custom editor!
Read the rest of this entry »