From 677825a26e0059b4e9b04d2277e5b1f24723cfe1 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Tue, 21 Jan 2025 11:47:12 +0800 Subject: [PATCH] =?UTF-8?q?3D=E4=BA=A4=E4=BA=92=E7=82=B9=E8=B7=B3=E6=AD=A5?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Item/Point3DItem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Assets/Scripts/Item/Point3DItem.cs b/Assets/Scripts/Item/Point3DItem.cs index 0f67e035..d8ca8442 100644 --- a/Assets/Scripts/Item/Point3DItem.cs +++ b/Assets/Scripts/Item/Point3DItem.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; using XMLTool; +using static OperationController; public class Point3DItem : MonoBehaviour { @@ -37,11 +38,18 @@ public class Point3DItem : MonoBehaviour rotSpeed = data.rotateSpeed; gameObject.GetComponent().sortingOrder = data.order; TypeEventSystem.Global.Register(OnObjDestroy).UnRegisterWhenGameObjectDestroyed(gameObject); + TypeEventSystem.Global.Register(OnStepChanged); } + private void OnStepChanged(StepStatusOnChange change) + { + OnObjDestroy(default); + } + private void OnObjDestroy(OnPoint3DQuestionDestroy destroy) { + TypeEventSystem.Global.UnRegister(OnStepChanged); GameObject.Destroy(gameObject); }