mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Add xmldoc and tidy up logic in Skin
This commit is contained in:
parent
992a052426
commit
c93ed541f3
@ -61,11 +61,19 @@ namespace osu.Game.Skinning
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove all stored customisations for the provided target.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="targetContainer">The target container to reset.</param>
|
||||||
public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer)
|
public void ResetDrawableTarget(SkinnableElementTargetContainer targetContainer)
|
||||||
{
|
{
|
||||||
DrawableComponentInfo.Remove(targetContainer.Target);
|
DrawableComponentInfo.Remove(targetContainer.Target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update serialised information for the provided target.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="targetContainer">The target container to serialise to this skin.</param>
|
||||||
public void UpdateDrawableTarget(SkinnableElementTargetContainer targetContainer)
|
public void UpdateDrawableTarget(SkinnableElementTargetContainer targetContainer)
|
||||||
{
|
{
|
||||||
DrawableComponentInfo[targetContainer.Target] = targetContainer.CreateSerialisedChildren().ToArray();
|
DrawableComponentInfo[targetContainer.Target] = targetContainer.CreateSerialisedChildren().ToArray();
|
||||||
@ -76,10 +84,7 @@ namespace osu.Game.Skinning
|
|||||||
switch (component)
|
switch (component)
|
||||||
{
|
{
|
||||||
case SkinnableTargetComponent target:
|
case SkinnableTargetComponent target:
|
||||||
|
if (!DrawableComponentInfo.TryGetValue(target.Target, out var skinnableInfo))
|
||||||
var skinnableTarget = target.Target;
|
|
||||||
|
|
||||||
if (!DrawableComponentInfo.TryGetValue(skinnableTarget, out var skinnableInfo))
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return new SkinnableTargetWrapper
|
return new SkinnableTargetWrapper
|
||||||
|
Loading…
Reference in New Issue
Block a user