Image Effect)
">Hello, I wanted to ask if it was possible to manage different effects
in the room at different times in the same scene (Standard Asset->
Image Effect)
I admit they are not very good at programming, I have been found after
a "Camera Effect" where he addressed the problem, I tried in every way
but I could not make it work.
in the post "Camera Effect" Chris says:
That's
right - simple enough to do, you could even just have a script That has
functions to enable and disable the entire "effect" component. In C, this would be something like:
void TurnOnEffect ()
{
().enabled = true;
">this.GetComponent <MyEffect> (). enabled = true;
}
void TurnOffEffect ()
{
().enabled = false;
">this.GetComponent <MyEffect> (). enabled = false;
}
Attach the script to your GameCamera, then use the Object: Action Send
message to send the custom messages "TurnOnEffect" and "TurnOffEffect"
as appropriate.
I tried as indicated but Unity me by several errors when creating the script.
My setup is:
Windows 7 professional
unity 5.2.1f1
AC 1.49a
As mentioned I tried to look for other posts, but in the end I did not understand if it is possible or not.
Thank you and hope not that you have not created a useless post.
hello Seto
Comments
What is it you're trying to do, exactly? Tweak an effect from camera to camera, or have one only active when a particular camera is active?
I am that I can not do it.
I want to have a particular effect when a particular camera is active.
And I can not turn on and off inside the MainCamera.
You have to have a script that checks if the GameCamera in question is active.
e.g:
void Update ()
{
if (AC.KickStarter.mainCamera.attachedCamera == myCameraWithEffect)
{
// Turn on the effect
}
else
{
// Turn off the effect
}
}