Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Disabling Editor Script on Runtime

Discussion in 'Scripting' started by miszu, Dec 29, 2015.

  1. miszu

    miszu

    Joined:
    Aug 18, 2015
    Posts:
    8
    Hi,

    I made a game and I am using Motion Blur, Anti-Aliasing and Sun shafts scripts from the ImageEffects assets. As in most video game, you have the option to enable/disable those effects. However those scripts are Editor Script and I have no clue how I can disable on runtime. Any suggestion?
     
  2. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,184
    Why are your ImageEffects editor scripts? They should be attached as components to your camera object and not be placed in the "Editor" folder. Then you can simply turn off the component or get a reference to it and change the values at runtime.
     
  3. miszu

    miszu

    Joined:
    Aug 18, 2015
    Posts:
    8
    Nevermind I found the error. In my code I need to write "using UnityStandardAssets.ImageEffects;" Otherwise I couldn't access the scripts.