Ejemplo n.º 1
0
 internal void Light()
 {
     allLights = LightObject.GetLights();
     DirectionalLights.Clear();
     PointLights.Clear();
     SpotLights.Clear();
     for (int i = 0; i < allLights.Count; i++)
     {
         if (allLights[i].type == LightType.Spot)
         {
             //if (l.cookie == null)
             //    l.cookie = DefaultSpotCookie;
             SpotLights.Add(allLights[i]);
         }
         else if (allLights[i].type == LightType.Point)
         {
             PointLights.Add(allLights[i]);
         }
         else if (allLights[i].type == LightType.Directional)
         {
             DirectionalLights.Add(allLights[i]);
         }
         if (UseAlloyLight)
         {
             allLights[i].light.GetOrAddComponent <AlloyAreaLight>().UpdateBinding();
         }
     }
 }
Ejemplo n.º 2
0
        internal void Light()
        {
            allLights = LightObject.GetLights();
            DirectionalLights.Clear();
            PointLights.Clear();
            SpotLights.Clear();
            for (int i = 0; i < allLights.Count; i++)
            {
                if (allLights[i].type == LightType.Spot)
                {
                    //if (l.cookie == null)
                    //    l.cookie = DefaultSpotCookie;
                    SpotLights.Add(allLights[i]);
                }
                else if (allLights[i].type == LightType.Point)
                {
                    PointLights.Add(allLights[i]);
                }
                else if (allLights[i].type == LightType.Directional)
                {
                    if (Graphics.Instance.Settings.UsePCSS)
                    {
                        if (null == pcss)
                        {
                            pcss = allLights[i].light.GetOrAddComponent <PCSSLight>();
                        }
                        if (null != pcss)
                        {
                            pcss.enabled = true;
                        }
                    }
                    else
                    {
                        if (null == pcss)
                        {
                            pcss = allLights[i].light.GetComponent <PCSSLight>();
                        }
                        if (null != pcss)
                        {
                            pcss.enabled = false;
                        }
                    }

                    DirectionalLights.Add(allLights[i]);
                }
                if (UseAlloyLight)
                {
                    allLights[i].light.GetOrAddComponent <AlloyAreaLight>().UpdateBinding();
                }
            }
        }