1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00
osu-lazer/osu.Game/Storyboards/Drawables/StoryboardLayer.cs
2017-09-08 09:08:52 +02:00

38 lines
1.1 KiB
C#

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Storyboards.Drawables
{
public class StoryboardLayer : Container
{
public LayerDefinition Definition { get; private set; }
public bool Enabled;
public override bool IsPresent => Enabled && base.IsPresent;
public StoryboardLayer(LayerDefinition definition)
{
Definition = definition;
RelativeSizeAxes = Axes.Both;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Enabled = definition.EnabledWhenPassing;
}
[BackgroundDependencyLoader]
private void load()
{
foreach (var element in Definition.Elements)
{
var drawable = element.CreateDrawable();
if (drawable != null)
Add(drawable);
}
}
}
}