增加参数保存功能

This commit is contained in:
ww-rm
2025-06-15 14:38:37 +08:00
parent 0dcf8c5577
commit 7bd3e3669b
5 changed files with 113 additions and 17 deletions

View File

@@ -13,6 +13,8 @@ namespace SpineViewer.Models
{
public class SpineObjectConfigModel
{
public bool IsShown { get; set; } = true;
public bool UsePma { get; set; }
public string Physics { get; set; } = ISkeleton.Physics.Update.ToString();

View File

@@ -359,6 +359,8 @@ namespace SpineViewer.Models
FlipY = _spineObject.Skeleton.ScaleY < 0,
X = _spineObject.Skeleton.X,
Y = _spineObject.Skeleton.Y,
IsShown = _isShown,
UsePma = _spineObject.UsePma,
Physics = _spineObject.Physics.ToString(),
@@ -399,6 +401,8 @@ namespace SpineViewer.Models
SetProperty(_spineObject.Skeleton.ScaleY < 0, config.FlipY, v => _spineObject.Skeleton.ScaleY *= -1, nameof(FlipY));
SetProperty(_spineObject.Skeleton.X, config.X, v => _spineObject.Skeleton.X = v, nameof(X));
SetProperty(_spineObject.Skeleton.Y, config.Y, v => _spineObject.Skeleton.Y = v, nameof(Y));
IsShown = config.IsShown;
SetProperty(_spineObject.UsePma, config.UsePma, v => _spineObject.UsePma = v, nameof(UsePma));
SetProperty(_spineObject.Physics, Enum.Parse<ISkeleton.Physics>(config.Physics ?? "Update", true), v => _spineObject.Physics = v, nameof(Physics));