|
I have a camera that has the DepthOfField.js attached to it. And I want to access to this component from another object using on a C# script. But I get and error on the DepthOfField type (is unknown), also if I try "DepthOfField", I get the same error. Any suggestions?
(comments are locked)
|
|
First of all, the code you post here is "Java Script" (Unity Script). The following code should work in your C# script, if the order in which scripts are compiled is set up right. Why not port the DepthOfField.js to C#? DepthOfField.js is one of the Unity Pro Image Processing scripts, and it is supplied as a .js :)
May 09 '12 at 05:24 PM
aljndrrr
(comments are locked)
|
|
click on your C# script and in the upper right part of its inspector, youll see compilation order. Click on that, and add that script to the list. Doesnt matter its order. And hit apply. That most likely will solve your issue. I can't seem to find the button for the compilation order, I'm using Unity 3.2
May 09 '12 at 05:09 PM
aljndrrr
(comments are locked)
|

Probably related to the order in which scripts are compiled. See http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html.