How do I ref JS class with Cs script???

how???help me…

you cannot integrate a JS script which is a class itselft or a single class in CSharp, you need to write your class in CSharp. Else sometime ago I foind something, I will post if I refound it!

No at max you can only communicate by using SendMessage (), but you cannot use a JS Class into your CS Script!

I believed I could…ok thanks anyway…

You can as long as you follow the compilation order.

DanielQuick,you mean i put ref class in Plugins folder???I tried but failed.I think I should use sendmessage.

I recomend you translate the Javascript script into C# so you dont have to worry about that, if what you are using is the Third person controller I have it translated, look at my signature.

Nm, was above… Referenced Send message.

translation of js 2 cs cannot be done because js classes are too many,and cs 2 js cannot be done because of grammer trouble.(some code in cs throw exception,but I dont know how to do it with js.the grammer trouble…it is not "try{}… catch{} …"this easy in js)

Of course it can be done, the third person controller I translated was 500 lines long, it was a pain in the ass, but it can be done. Anyways, it was just a recomendation, you dont have to do it if you want to, but in the long run I think its better to have everything in the same language to avoid things like having to put C# scripts in different folders to access some JS’s script classes.

ok,i suck again…

You could find a universal compiler that allows C# or US* to be compiled into assembly into a dll then just drag that into and you can use that in both fashions.

  • Unity Script a.k.a. what everyone calls javascript but is far from javascript internally.

I knew.