예제 #1
0
    public void Run(Eshadow shadows)
    {
        if(debug)Debug.Log("AlterRange: TWO: " + enabled+" : " + shadows);
        //if (!enabled) return;
        //if (Application.isPlaying) return;
        GetComponentsInChildren<Light>().ToList().ForEach(o => {
            if (gameTags != null&&gameTags.Count==0) {
                foreach (var gameTag in gameTags) {
                    if (o.gameObject.tag == gameTag) {
                        if(alterRange)o.range = range;
                        if(shadows== Eshadow.soft)o.shadows = LightShadows.Soft;
                        if(shadows== Eshadow.hard)o.shadows = LightShadows.Hard;
                        if(shadows== Eshadow.none)o.shadows = LightShadows.None;

                    }
                }
            }
            if (names != null) {
                foreach (var iname in names) {
                    if (o.gameObject.name.Contains(iname)) {
                        if(alterRange)o.range = range;
                        if(shadows== Eshadow.soft)o.shadows = LightShadows.Soft;
                        if(shadows== Eshadow.hard)o.shadows = LightShadows.Hard;
                        if(shadows== Eshadow.none)o.shadows = LightShadows.None;
                    }
                }
            }

        } );
    }
예제 #2
0
파일: AlterRange.cs 프로젝트: ajmed/blink
 public void Run(Eshadow shadows)
 {
     if (debug)
     {
         Debug.Log("AlterRange: TWO: " + enabled + " : " + shadows);
     }
     //if (!enabled) return;
     //if (Application.isPlaying) return;
     GetComponentsInChildren <Light>().ToList().ForEach(o => {
         if (gameTags != null && gameTags.Count == 0)
         {
             foreach (var gameTag in gameTags)
             {
                 if (o.gameObject.tag == gameTag)
                 {
                     if (alterRange)
                     {
                         o.range = range;
                     }
                     if (shadows == Eshadow.soft)
                     {
                         o.shadows = LightShadows.Soft;
                     }
                     if (shadows == Eshadow.hard)
                     {
                         o.shadows = LightShadows.Hard;
                     }
                     if (shadows == Eshadow.none)
                     {
                         o.shadows = LightShadows.None;
                     }
                 }
             }
         }
         if (names != null)
         {
             foreach (var iname in names)
             {
                 if (o.gameObject.name.Contains(iname))
                 {
                     if (alterRange)
                     {
                         o.range = range;
                     }
                     if (shadows == Eshadow.soft)
                     {
                         o.shadows = LightShadows.Soft;
                     }
                     if (shadows == Eshadow.hard)
                     {
                         o.shadows = LightShadows.Hard;
                     }
                     if (shadows == Eshadow.none)
                     {
                         o.shadows = LightShadows.None;
                     }
                 }
             }
         }
     });
 }