mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Add lazy weak property to DrawableOsuHitObject to find and cache the containing OsuInputManager, if it exists
This commit is contained in:
parent
306c00e593
commit
9c6ca2d159
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// 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 System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Osu.Judgements;
|
using osu.Game.Rulesets.Osu.Judgements;
|
||||||
@ -51,6 +52,19 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
|||||||
protected virtual void UpdateCurrentState(ArmedState state)
|
protected virtual void UpdateCurrentState(ArmedState state)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private WeakReference<OsuInputManager> osuActionInputManager = new WeakReference<OsuInputManager>(null);
|
||||||
|
internal OsuInputManager OsuActionInputManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
OsuInputManager target = null;
|
||||||
|
if (osuActionInputManager.TryGetTarget(out target)) return target;
|
||||||
|
target = GetContainingInputManager() as OsuInputManager;
|
||||||
|
osuActionInputManager.SetTarget(target);
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ComboResult
|
public enum ComboResult
|
||||||
|
Loading…
Reference in New Issue
Block a user