mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Only create drawables for storyboard elements that will be visible.
This commit is contained in:
@ -14,9 +14,6 @@ namespace osu.Game.Storyboards.Drawables
|
||||
{
|
||||
public StoryboardAnimation Animation { get; private set; }
|
||||
|
||||
protected override bool ShouldBeAlive => Animation.HasCommands && base.ShouldBeAlive;
|
||||
public override bool RemoveWhenNotAlive => !Animation.HasCommands || base.RemoveWhenNotAlive;
|
||||
|
||||
public bool FlipH { get; set; }
|
||||
public bool FlipV { get; set; }
|
||||
|
||||
@ -59,11 +56,8 @@ namespace osu.Game.Storyboards.Drawables
|
||||
Position = animation.InitialPosition;
|
||||
Repeat = animation.LoopType == AnimationLoopType.LoopForever;
|
||||
|
||||
if (animation.HasCommands)
|
||||
{
|
||||
LifetimeStart = animation.StartTime;
|
||||
LifetimeEnd = animation.EndTime;
|
||||
}
|
||||
LifetimeStart = animation.StartTime;
|
||||
LifetimeEnd = animation.EndTime;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
@ -28,9 +28,8 @@ namespace osu.Game.Storyboards.Drawables
|
||||
{
|
||||
foreach (var element in Layer.Elements)
|
||||
{
|
||||
var drawable = element.CreateDrawable();
|
||||
if (drawable != null)
|
||||
Add(drawable);
|
||||
if (element.IsDrawable)
|
||||
Add(element.CreateDrawable());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,9 +14,6 @@ namespace osu.Game.Storyboards.Drawables
|
||||
{
|
||||
public StoryboardSprite Sprite { get; private set; }
|
||||
|
||||
protected override bool ShouldBeAlive => Sprite.HasCommands && base.ShouldBeAlive;
|
||||
public override bool RemoveWhenNotAlive => !Sprite.HasCommands || base.RemoveWhenNotAlive;
|
||||
|
||||
public bool FlipH { get; set; }
|
||||
public bool FlipV { get; set; }
|
||||
|
||||
@ -58,11 +55,8 @@ namespace osu.Game.Storyboards.Drawables
|
||||
Origin = sprite.Origin;
|
||||
Position = sprite.InitialPosition;
|
||||
|
||||
if (sprite.HasCommands)
|
||||
{
|
||||
LifetimeStart = sprite.StartTime;
|
||||
LifetimeEnd = sprite.EndTime;
|
||||
}
|
||||
LifetimeStart = sprite.StartTime;
|
||||
LifetimeEnd = sprite.EndTime;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
Reference in New Issue
Block a user