Skip to content

Instantly share code, notes, and snippets.

@rc1
Created March 8, 2016 13:40
Show Gist options
  • Select an option

  • Save rc1/1ca2d970bda669c76c5e to your computer and use it in GitHub Desktop.

Select an option

Save rc1/1ca2d970bda669c76c5e to your computer and use it in GitHub Desktop.
Unity Workshop
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