重构并增加HitTest
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Spine.SpineWrappers;
|
||||
using SpineViewer.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Spine.SpineWrappers;
|
||||
using Spine.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
@@ -15,7 +15,7 @@ using System.Windows.Media.Imaging;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using NLog;
|
||||
using Spine;
|
||||
using Spine.SpineWrappers;
|
||||
using Spine.Interfaces;
|
||||
using SpineViewer.Extensions;
|
||||
|
||||
namespace SpineViewer.Models
|
||||
@@ -428,6 +428,14 @@ namespace SpineViewer.Models
|
||||
lock (_lock) return _spineObject.GetCurrentBounds();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 命中检测, 可以比整体包围盒略精确一点
|
||||
/// </summary>
|
||||
public bool HitTest(float x, float y)
|
||||
{
|
||||
lock (_lock) return _spineObject.Skeleton.HitTest(x, y);
|
||||
}
|
||||
|
||||
public SpineObjectConfigModel ObjectConfig
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user