Created
March 8, 2016 13:40
-
-
Save rc1/dab1066e084b5aba085c to your computer and use it in GitHub Desktop.
Unity Workshop Toggle Image Effect
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