From d2b9b32fe3ed2f71ef90f56cbb45f2712bff9441 Mon Sep 17 00:00:00 2001
From: Han <1985708279@qq.com>
Date: Tue, 22 Apr 2025 14:17:02 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90M=E3=80=91Rokid=E5=B7=A5=E5=85=B7?=
=?UTF-8?q?=E6=89=A9=E5=B1=95=E6=9B=B4=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AddInteraction/RKAddInteraction.cs | 24 +++++++++----------
Assets/07.RKTools/package.json | 2 +-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/Assets/07.RKTools/RunTime/AddInteraction/RKAddInteraction.cs b/Assets/07.RKTools/RunTime/AddInteraction/RKAddInteraction.cs
index 56afc77..598d5ea 100644
--- a/Assets/07.RKTools/RunTime/AddInteraction/RKAddInteraction.cs
+++ b/Assets/07.RKTools/RunTime/AddInteraction/RKAddInteraction.cs
@@ -4,7 +4,7 @@ using Rokid.UXR.Interaction;
using Stary.Evo;
using UnityEngine;
-public abstract class RKAddInteraction : MonoBehaviour
+public static class RKAddInteractionExtension
{
#region 触摸
///
@@ -12,7 +12,7 @@ public abstract class RKAddInteraction : MonoBehaviour
///
/// 被触碰物体
/// 触碰后事件
- public virtual void ObjectAddTouchEvent(GameObject Touchedobject, System.Action TouchEvent, float TouchScale = 1.2f)
+ public static void ObjectAddTouchEvent(this GameObject Touchedobject, System.Action TouchEvent, float TouchScale = 1.2f)
{
Collider ObjectCollider = Touchedobject.GetComponent();
GrabInteractable GrabInteractable = Touchedobject.GetComponent();
@@ -37,7 +37,7 @@ public abstract class RKAddInteraction : MonoBehaviour
/// 暂停触摸事件
///
/// 被触碰物体
- public virtual void ObjectPauseTouchEvent(GameObject Touchedobject)
+ public static void ObjectPauseTouchEvent(this GameObject Touchedobject)
{
Collider ObjectCollider = Touchedobject.GetComponent();
if (ObjectCollider != null)
@@ -50,7 +50,7 @@ public abstract class RKAddInteraction : MonoBehaviour
/// 恢复触摸事件
///
/// 被触碰物体
- public virtual void ObjectResumeTouchEvent(GameObject Touchedobject)
+ public static void ObjectResumeTouchEvent(this GameObject Touchedobject)
{
Collider ObjectCollider = Touchedobject.GetComponent();
if (ObjectCollider != null)
@@ -64,14 +64,14 @@ public abstract class RKAddInteraction : MonoBehaviour
///
/// 被触碰物体
- public virtual void ObjectRemoveTouchEvent(GameObject Touchedobject)
+ public static void ObjectRemoveTouchEvent(this GameObject Touchedobject)
{
GrabInteractable GrabInteractable = Touchedobject.GetComponent();
if (GrabInteractable != null)
{
GrabInteractable.OnHoverBegin.RemoveAllListeners();
- Destroy(GrabInteractable);
+ Object.Destroy(GrabInteractable);
}
}
@@ -84,7 +84,7 @@ public abstract class RKAddInteraction : MonoBehaviour
///
/// 被拖动物体
/// 拖动时执行的方法
- public virtual void objectAddDrag(GameObject Dragedobject, System.Action DragingEvent = null, float DragScale = 1.2f)
+ public static void objectAddDrag(this GameObject Dragedobject, System.Action DragingEvent = null, float DragScale = 1.2f)
{
Collider ObjectCollider = Dragedobject.GetComponent();
GrabInteractable GrabInteractable = Dragedobject.GetComponent();
@@ -122,7 +122,7 @@ public abstract class RKAddInteraction : MonoBehaviour
/// 暂停拖动
///
///
- public virtual void objectPauseDrag(GameObject Dragedobject)
+ public static void objectPauseDrag(this GameObject Dragedobject)
{
Collider ObjectCollider = Dragedobject.GetComponent();
if (ObjectCollider!= null) ObjectCollider.enabled = false;
@@ -132,21 +132,21 @@ public abstract class RKAddInteraction : MonoBehaviour
/// 恢复拖动
///
///
- public virtual void objectResumeDrag(GameObject Dragedobject)
+ public static void objectResumeDrag(this GameObject Dragedobject)
{
Collider ObjectCollider = Dragedobject.GetComponent();
if (ObjectCollider!= null) ObjectCollider.enabled = true;
}
- public virtual void objectRemoveDrag(GameObject Dragedobject)
+ public static void objectRemoveDrag(this GameObject Dragedobject)
{
Throwable Throwable = Dragedobject.GetComponent();
GrabInteractable GrabInteractable = Dragedobject.GetComponent();
- if (Throwable != null) Destroy(Throwable);
+ if (Throwable != null) Object.Destroy(Throwable);
if (GrabInteractable != null)
{
GrabInteractable.OnHeldUpdate.RemoveAllListeners();
- Destroy(GrabInteractable);
+ Object.Destroy(GrabInteractable);
}
}
#endregion
diff --git a/Assets/07.RKTools/package.json b/Assets/07.RKTools/package.json
index ff9b23a..7596d0a 100644
--- a/Assets/07.RKTools/package.json
+++ b/Assets/07.RKTools/package.json
@@ -1,6 +1,6 @@
{
"name": "com.staryevo.rktools",
- "version": "1.0.0",
+ "version": "1.0.1",
"displayName": "07.RKTools",
"description": "Rokid工具",
"unity": "2021.3",