On StackOverflow, someone asks how to detect the GUI Window Created/Closed Event, which Unity3D does not ship an off-the-shelf solution.
Below is my solution to this problem: to use property setter to handle this. Here is the sample code:
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!