Skip to content

Commit

Permalink
fix: ScriptableLogicが切り替えのたびにリセットされてしまう不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
pspkurara committed Nov 5, 2020
1 parent a8c0731 commit 1b996fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Packages/uGUI-Skinner/Runtime/SkinLogicProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ internal SkinLogicProperty(SkinLogicProperty @base) : this(@base.m_SkinPartsProp

#endregion

#region メソッド

/// <summary>
/// 内部の<see cref="SkinPartsPropertry"/>を元の参照から切り離したものを取得する
/// </summary>
/// <param name="base">自身</param>
/// <returns>独立した参照を持つバージョン</returns>
internal static SkinLogicProperty GetCopyWithUniqueSkinPartsProperty(SkinLogicProperty @base)
{
var clone = new SkinLogicProperty(@base);
clone.m_SkinPartsProperty = new SkinPartsPropertry(clone.m_SkinPartsProperty);
return clone;
}

#endregion

}

Expand Down
3 changes: 2 additions & 1 deletion Packages/uGUI-Skinner/Runtime/SkinParts/ScriptableLogic.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;

namespace Pspkurara.UI.Skinner
{
Expand Down Expand Up @@ -38,7 +39,7 @@ public void SetValues(SkinLogicProperty property)
}
if (!ignoredLogicProperty.HasValue)
{
ignoredLogicProperty = new SkinLogicProperty(property);
ignoredLogicProperty = SkinLogicProperty.GetCopyWithUniqueSkinPartsProperty(property);
ignoredLogicProperty.Value.objectReferenceValues.Remove(userLogic);
}
UserLogicExtension.SetActiveUserLogic(userLogic);
Expand Down

0 comments on commit 1b996fb

Please sign in to comment.