static public void Draw(Pass pass) { for (int id = 0; id < pass.sortList.count; id++) { Sorting.SortObject sortObject = pass.sortList.list[id]; switch (sortObject.type) { case Sorting.SortObject.Type.TilemapRoom: LightTilemapRoom2D tilemapRoom = (LightTilemapRoom2D)sortObject.lightObject; if (tilemapRoom != null) { TilemapRoom.Draw(tilemapRoom, pass.camera); } break; case Sorting.SortObject.Type.Room: LightRoom2D room = (LightRoom2D)sortObject.lightObject; if (room != null) { Room.Draw(room, pass.camera); } break; case Sorting.SortObject.Type.LightSprite: LightSprite2D lightSprite = (LightSprite2D)sortObject.lightObject; if (lightSprite != null) { LightSprite.Draw(lightSprite, pass.camera); } break; case Sorting.SortObject.Type.Light: Light2D light = (Light2D)sortObject.lightObject; if (light != null) { LightSource.Draw(light, pass.camera); } break; } } }
private static void DrawLightSprites_scriptable(Pass pass) { List <Scriptable.LightSprite2D> spriteRendererList = Scriptable.LightSprite2D.List; int spriteRendererCount = spriteRendererList.Count; if (spriteRendererCount < 1) { return; } for (int i = 0; i < spriteRendererCount; i++) { Scriptable.LightSprite2D id = spriteRendererList[i]; if (id.NightLayer != pass.layerId) { continue; } LightSprite.Draw_scriptable(id, pass.camera); } }