Search Unity

Global Shadow Toggle

Discussion in 'Scripting' started by tsphillips, Feb 5, 2006.

  1. tsphillips

    tsphillips

    Joined:
    Jan 9, 2006
    Posts:
    359
    I'm trying to figure out a clean/elegant way to globally toggle shadows on and off. Has anyone tackled this already? If so, how did you approach it?
     
  2. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    I'd say somthing like:
    Code (csharp):
    1.  
    2.     projectors = FindObjectsOfType (Projector);
    3.     for (var p : Projector in projectors) {
    4.         p.enabled = false;
    5.     }
    6.  
     
  3. tsphillips

    tsphillips

    Joined:
    Jan 9, 2006
    Posts:
    359
    I rewrote it for C#, but it works great - thanks. :)