- Home /
Can´t add Imageeffect-component at runtime.. Namespace?
Hi,
i want to add the "LuminanceBlur"-filter to all my camera objects at runtime but the namespace could not be found. All my scripts are in the "Standard Assets" folder. Any ideas what to do?
error CS0246: The type or namespace name `LuminanceEdgeBlur' could not be found. Are you missing a using directive or an assembly reference?
foreach (GameObject cam in _camArray)
{
LuminanceEdgeBlur l = _camExt.AddComponent<LuminanceEdgeBlur>();
l.offsetScale = 0.05f;
l.blurRadius = 70.0f;
}
Under which path at the project browser, is the C# script from which you took this code snippet found? Also, is "Lu$$anonymous$$anceEdgeBlur" a javascript or a C# script and under which path is it? Check this out: http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html
$$anonymous$$y script in which i want to use the snippet above is here: "Standard Assets/Scripts/$$anonymous$$anager/Controller.cs". The "Lu$$anonymous$$anceEdgeBlur.js" is javascript and thats the original filter within the default unity content. How can i use this js file with c# ?
Answer by GuyTidhar · Aug 23, 2011 at 11:56 AM
Put Controller.cs outside of "Standard Assets". E.g. open your own: "Scripts/Manager/Controller.cs". I wouldn't put your own scripts under Standard Assets as a role.