- Home /
This question was
closed Oct 04, 2017 at 05:31 AM by
MohammadAlizadeh for the following reason:
The question is answered, right answer was accepted
enable Blur effect when Esc button pressed (Windows Phone 8)
Hi, i have a FPS char that contains a Blur effect on the Main Camera which i want to active the Blur effect when i press the back button so i don't how to do it and here's my super simple code :
using UnityEngine;
using System.Collections;
public class QuitOnGui1 : MonoBehaviour {
public GameObject Yes;
//public Blur blur;
void Update () {
if (Input.GetKeyDown (KeyCode.Escape))
//blur = GetComponent<Blur>();
//blur.enabled = true;
//GetComponent<Blur>().enabled = true;
Yes.SetActive (true);
}
}
bandicam-2015-10-03-19-52-13-725.jpg
(75.8 kB)
Comment
Answer by MohammadAlizadeh · Oct 03, 2015 at 05:12 PM
The Answer is this : (gameObject.GetComponent( "Blur" ) as MonoBehaviour).enabled = true;