Use IsAssignableFrom.

This commit is contained in:
Huo Yaoyuan
2017-05-13 21:28:53 +08:00
parent 8b6d0864f0
commit b9a40a841b
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ namespace osu.Game.Graphics.UserInterface
protected virtual void TransformCount(T currentValue, T newValue) protected virtual void TransformCount(T currentValue, T newValue)
{ {
Debug.Assert( Debug.Assert(
TransformType.IsSubclassOf(typeof(Transform<T>)) || TransformType == typeof(Transform<T>), typeof(Transform<T>).IsAssignableFrom(TransformType),
@"transformType should be a subclass of Transform<T>." @"transformType should be a subclass of Transform<T>."
); );

View File

@ -81,7 +81,7 @@ namespace osu.Game.Overlays
hasCompletionTarget.CompletionTarget = Post; hasCompletionTarget.CompletionTarget = Post;
var ourType = notification.GetType(); var ourType = notification.GetType();
sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => ourType == accept || ourType.IsSubclassOf(accept)))?.Add(notification); sections.Children.FirstOrDefault(s => s.AcceptTypes.Any(accept => accept.IsAssignableFrom(ourType)))?.Add(notification);
} }
protected override void PopIn() protected override void PopIn()