hi all
i want convert
var playerController : ThirdPersonController = GetComponent(ThirdPersonController); to c#.
ThirdPersonController is js.
i make a folder in game and named it Plugins and move my js file but i cant access it via c#. how can i access js file in via c#?
how can i do that?
thankful.
with one exception this should work, assuming the C# is in an appropriate place
and this one exception is unity iphone where C# can never access JS
but i use unity3d no unity3d for iphon.
then the access will work …
please show your c# code that attempts to access it, I would guess its an error due to forgetting to cast the return of GetComponent or something alike
ThirdPersonController playerController = GetComponent();
i use vs 2010.
still intellisense dont work.
error:
Error 1 The type or namespace name ‘ThirdPersonController’ could not be found (are you missing a using directive or an assembly reference?) C:\Users\1\Documents\MyNewProject\Assets\New Folder\MyScripts\PlayerAnimation.cs 35 9 MyNewProject
ah well thats something different.
that will logically not work cause a C# solution will only accept c#
autocompletition etc are restricted to C# within the solution
at edit time the JS / boo stuff does not exist at all yet as “.net assembly”, thats what happens when unity compiles it on the fly. thats also why compile order and special folders matter in this case
but in unity it will work fine.
then just define some variable, and take control of other script from here.
it will none the less throw errors in there cause the error console does something similar to unity with realtime checking, just that it is only able to do it on c# and imported assemblies
you spoke about it.
please tell me how can i correct that?
please show me with a little example like a sentance etc.
if you convert:
var playerController : ThirdPersonController = GetComponent(ThirdPersonController);
to c# then i very thankful.
the code above is correct
but VS will always show an error cause the JS code does not exist and so does none of its classes.
if you check it in the unity it will work fine.
very thankful.
how can correct vs intellisense?