- Home /
I Cant Disactive Image Effects
Hello Everyone I have Unity3D Pro and The Image Effects works fine
but i'm trying to make option menu
i use this codes
private BloomAndLensFlares bloomToggle;
bloomToggle = Camera.main.GetComponent("BloomAndLensFlares") as BloomAndLensFlares;
but the problem that i cant use :
bloomToggle.enabled = false;
i cant find enabled in the list.
i also tried
bloomToggle = Camera.main.GetComponent<BloomAndLensFlares>().enabled = false;
but also cant find "enabled"
the same code work with other Script but not work on Image Effects i dont know why
i heard that i must use
using Assets.Scripts;
But I Get This Error
Assets/Scripts/GameSettings.cs(3,7): error CS0246: The type or namespace name `Assets' could not be found. Are you missing a using directive or an assembly reference?
i hope someone got answer
Answer by newfinalflashers · Sep 26, 2015 at 06:21 PM
you must declare that you are using Unity.StandardAssets.ImageEffects; because it has a namespace.
I tried
using UnityEngine; using System.Collections; using Unity.StandardAssets.ImageEffects;
However, for your "using Unity.StandardAssets.ImageEffects;" it tells me: "Type or namespace "Unity" was not found (are you missing a using-directive or an assembly reference).
Answer by nsxdavid · Mar 12, 2013 at 09:27 PM
I tried this:
Camera.main.GetComponent<BloomAndLensFlares>().enabled = false;
Worked fine.
Not sure why you are having such difficulties, but one issue might have to do with BloomAndLensFlares being written in JavaScript and you are using C#. This can sometimes create problems due to the order in which scripts are compiled.
At First I would like to thank,, but that code didnt work he still cant find "enabled"
and yeah. the image-effect in java-script and i'm useing C# is there easy way to fix?
Your answer
Follow this Question
Related Questions
BloomAndFlares Monodevelop compile error 0 Answers
Noob trying to figure out Depth of Field, documentation (edited) 1 Answer
SSAO shader problem 0 Answers
Black and white effect on mobile? 0 Answers
Primitive Nitro Effect 1 Answer