void update ()
{
if (Input.GetKeyUp(KeyCode.Space))
{
myEffect.enabled =!myLight.enabled;
}}}
what should I put instead input getkeyup to have this working when I'm on the pause button?It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The code looks OK, but bear in mind that if the game is paused you'll need to have it in an Update function, not a FixedUpdate function, to work.
StateHandler stateHandler = GameObject.FindWithTag (Tags.persistentEngine).GetComponent <StateHandler>();
if (stateHandler.gameState == GameState.Paused)
{
// The game is paused
}
Maybe at the moment the boolean is private? (no is not just cheched)...
Public class BlurOn : MonoBehaviour
{
private BlurEffect myBlur;
void Start ()
{
myBlur = GetComponent<BlurEffect>();
}
void Update ()
{
if ??????????????????
{
myBlur.enabled = !myBlur.enabled;
}
}
}
the ?????????? is the part I'm missing...
I assigned a constant id to the main camera. then I did a script with void TurnOnEffect and void TurnOffEffect attached to the maincamera. Then I went into the menu manager and in the pause menu I added on the base action list ( the deselect inventory one) another actions (send object message custom turn on effect)...now it works...but I don't know if this was the right way to achieve what I was looking for.