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); }