Created
March 8, 2016 13:40
-
-
Save rc1/1ca2d970bda669c76c5e to your computer and use it in GitHub Desktop.
Unity Workshop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using UnityEngine.UI; | |
| using System.Collections; | |
| using UnityStandardAssets.ImageEffects; | |
| public class ToggleImageEffect : MonoBehaviour { | |
| public Toggle toggle; | |
| private ImageEffectBase imageEffect; | |
| // Use this for initialization | |
| void Start () { | |
| imageEffect = GetComponent<ImageEffectBase> (); | |
| } | |
| // Update is called once per frame | |
| void Update () { | |
| imageEffect.enabled = toggle.isOn; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment