sort of easy data binding?

is it possible to make a field for inspector for one certain script so that i can drop in some other c# script and then to automatically show me list of variables from dropped script to choose from? how hard it is if it is possible?

Thank you!

Think the script would have to compile for that to happen.

sorry can you elaborate? :slight_smile:

Not really lol, but wouldn’t that make sense, because to see variables in the inspector they have to be declared in that script. Also if something like that was easy to do we would all be doing it, and we prob would of at least heard of it on the asset store or somewhere.

What did you find from search on it ?

i use NGUI and in that package it is possible to place a mono script and choose function that matches delegate type to execute on OnFinished event (TweenPosition script), so i know it is possible, i was looking through the script but i do not have an idea how its done! I guessed that somebody more experience in forums could help here.

thanks for looking into this!

Totally possible, since I’m using a framework that support just that. Well, it’s not drag and drop as you can only use types deriving from the exposing field, but it’s possible.

How hard? I would say it’s fairly advanced.

What do you mean by choose function ?

That’s not the same as exposing variables in the inspector specific to a referenced script.

I attached the image that show how all methods (from mono script, in this case DataBind.cs script is attached to camera that has public void OnComplete() method) that match delegate void delegate() get listed in the dropdown list. selected method will be triggered when tween finishes (OnFinished event). So i need something similiar, but i need properties listed from a some any script so that i can use them.

1484218--82399--$Screen-Shot-2014-01-14-at-22.42.18.png

Ah! Well, that’s rather easy.

It’s called Reflection; http://msdn.microsoft.com/en-us/library/f7ykdhsy(v=vs.110).aspx

And what you need is a MethodInfo; http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo(v=vs.110).aspx