Beispiel #1
0
        public static void UpdateGameLevel(ref Game.LevelInfo.LevelData lvl)
        {
            for (int i = 0; i < lights.Count; i++)
            {
                Materials.PPPointLight light = lights[i];

                lvl.Lights.LightsList[i].Attenuation = light.Attenuation;
                lvl.Lights.LightsList[i].Color       = light.Color.R.ToString("X") + light.Color.G.ToString("X") + light.Color.B.ToString("X");
                lvl.Lights.LightsList[i].Position    = new Game.LevelInfo.Coordinates(light.Position);
            }

            while (lvl.Lights.LightsList.Count != lights.Count)
            {
                lvl.Lights.LightsList.RemoveAt(lvl.Lights.LightsList.Count - 1);
            }
        }
Beispiel #2
0
 public static int AddLight(Vector3 position, Color color, float attenuation)
 {
     Materials.PPPointLight elt = new Materials.PPPointLight(position, color, attenuation);
     lights.Add(elt);
     return(lights.IndexOf(elt));
 }