重构并增加HitTest
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Spine;
|
||||
using Spine.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -20,6 +20,7 @@ using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shell;
|
||||
using Spine.Interfaces;
|
||||
|
||||
namespace SpineViewer.ViewModels.MainWindow
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Microsoft.Win32;
|
||||
using NLog;
|
||||
using Spine.SpineWrappers;
|
||||
using Spine.Implementations;
|
||||
using SpineViewer.Models;
|
||||
using SpineViewer.Natives;
|
||||
using SpineViewer.Services;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Spine;
|
||||
using Spine.SpineWrappers;
|
||||
using Spine.Interfaces;
|
||||
using SpineViewer.Models;
|
||||
using System.Collections;
|
||||
using System.Collections.Immutable;
|
||||
|
||||
Reference in New Issue
Block a user