mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 09:27:18 +09:00
Only create drawables for storyboard elements that will be visible.
This commit is contained in:
parent
757a159516
commit
291486a4d1
@ -14,9 +14,6 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
{
|
{
|
||||||
public StoryboardAnimation Animation { get; private set; }
|
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 FlipH { get; set; }
|
||||||
public bool FlipV { get; set; }
|
public bool FlipV { get; set; }
|
||||||
|
|
||||||
@ -59,11 +56,8 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
Position = animation.InitialPosition;
|
Position = animation.InitialPosition;
|
||||||
Repeat = animation.LoopType == AnimationLoopType.LoopForever;
|
Repeat = animation.LoopType == AnimationLoopType.LoopForever;
|
||||||
|
|
||||||
if (animation.HasCommands)
|
LifetimeStart = animation.StartTime;
|
||||||
{
|
LifetimeEnd = animation.EndTime;
|
||||||
LifetimeStart = animation.StartTime;
|
|
||||||
LifetimeEnd = animation.EndTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -28,9 +28,8 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
{
|
{
|
||||||
foreach (var element in Layer.Elements)
|
foreach (var element in Layer.Elements)
|
||||||
{
|
{
|
||||||
var drawable = element.CreateDrawable();
|
if (element.IsDrawable)
|
||||||
if (drawable != null)
|
Add(element.CreateDrawable());
|
||||||
Add(drawable);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,6 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
{
|
{
|
||||||
public StoryboardSprite Sprite { get; private set; }
|
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 FlipH { get; set; }
|
||||||
public bool FlipV { get; set; }
|
public bool FlipV { get; set; }
|
||||||
|
|
||||||
@ -58,11 +55,8 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
Origin = sprite.Origin;
|
Origin = sprite.Origin;
|
||||||
Position = sprite.InitialPosition;
|
Position = sprite.InitialPosition;
|
||||||
|
|
||||||
if (sprite.HasCommands)
|
LifetimeStart = sprite.StartTime;
|
||||||
{
|
LifetimeEnd = sprite.EndTime;
|
||||||
LifetimeStart = sprite.StartTime;
|
|
||||||
LifetimeEnd = sprite.EndTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace osu.Game.Storyboards
|
namespace osu.Game.Storyboards
|
||||||
{
|
{
|
||||||
@ -21,6 +22,8 @@ namespace osu.Game.Storyboards
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Drawable CreateDrawable()
|
public Drawable CreateDrawable()
|
||||||
=> null;
|
{
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user