RSS

Tag Archives: inspector

Unity3D: Get inspector property values programatically


Recently, I found an interesting question in Unity3D. How to get some field value shown in Unity3D inspector programmatically? Largely this is an undocumented area, and it took me some research to get this done.

In what follows, I am getting the value for Input Manage Axes, as shown below:

image

Read the rest of this entry »

Advertisements
 
1 Comment

Posted by on October 25, 2016 in Programming, Unity 3d

 

Tags: , , , , , , , , , , ,

Unity3D: inspector control value changed event handling


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:

image  image

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 »

 
1 Comment

Posted by on January 11, 2014 in Programming, Unity 3d

 

Tags: , , , , , , , ,