Example #1
0
 /// <summary>
 /// Updates all dungeon lights.
 /// </summary>
 private static void UpdateLights()
 {
     ClearAllCellsAlpha();
     MainLight.Update(MainPlayer.Y, MainPlayer.X);
     ExitLight.Update();
     SetLight(MainLight);
     SetLight(ExitLight);
 }
    public MainLight GetClosestLight(MainLight mainLight)
    {
        var lights = InactiveLights.Where(p => !p.InDarkZone && p != mainLight);

        var closestLight = lights.OrderBy(p => Vector2.Distance(p.transform.position, mainLight.transform.position)).FirstOrDefault();

        return(closestLight);
    }
Example #3
0
 void initLight()
 {
     mainLight = new MainLight();
     mainLight.init();
 }