How to use both C# and Java in one project?

I was using Unity3d’s own MouseOrbit script (in JavaS) when I realize I can’t access it through GetComponent in C#… all I did next was to port it to C#… which was a bit waste of time…

Is there anything that I can do to access a JavaS file from C#… in a simpler way?

try this inside the js code

//those can be global
var cs;
var script;

//those can go at the Start() method
cs = GameObject.Find(“GameobjectName”);
script = cs.GetComponent(“ComponentName”);

now script has the c# class in it and you can access its public methods and variables
like:
script.giveInformation(“trololol”);

one important thing that the .cs file must compiled first, so it must be at the folder standard assets

Just as an additional tidbit, if you have defined classes or other types in a C# file for example, once you put it in Standard Assets you’ll be able to use those types in your Javascript, even without assigning the C# script as a variable in the Javascript. Helpful for projects with multiple developers.

thankx kamicazer.But i want to know if a .obj 3d had not a default animation ,but we call the animation written in javascript in c# file.
So it gave nullrefence exception.Can we please tell me how to add animation clip to the .obj ed so dat i can play animation?is dere any altenate way for dat???

It is not possible to store animation to a .obj file - they only store basic geometric data (vertex positions, vertex normals, 1 set of UV coordinates, list of triangles). No bones, no skin weights, no animation or keyframes, etc…

You’d have to assign skinning and bones and such at run-time… which just gets complex.