diff --git a/src/note.cpp b/src/note.cpp index bdb84be..3335181 100644 --- a/src/note.cpp +++ b/src/note.cpp @@ -3,6 +3,7 @@ #include "GlobalNamespace/ColorNoteVisuals.hpp" #include "GlobalNamespace/ILazyCopyHashSet_1.hpp" #include "GlobalNamespace/NoteData.hpp" +#include "GlobalNamespace/NoteController.hpp" #include "UnityEngine/MaterialPropertyBlock.hpp" #include "UnityEngine/MeshFilter.hpp" #include "UnityEngine/MeshRenderer.hpp" @@ -404,8 +405,13 @@ UnityEngine::Transform* CustomModels::PreviewNotes(UnityEngine::Vector3 position GetDefaultBomb()->transform->SetParent(preview, false); } else { auto parent = GetDefaultNotes()->transform; - ColorDefaultNotes(parent, MenuLeftColor(), MenuRightColor()); parent->SetParent(preview, false); + + for (auto noteController : parent->GetComponentsInChildren()) { + UnityEngine::Object::DestroyImmediate(noteController); + } + + ColorDefaultNotes(parent, MenuLeftColor(), MenuRightColor()); } RemoveLoadingGuard(); diff --git a/src/wall.cpp b/src/wall.cpp index adfa3c0..a587722 100644 --- a/src/wall.cpp +++ b/src/wall.cpp @@ -3,6 +3,7 @@ #include "GlobalNamespace/ObstacleMaterialSetter.hpp" #include "GlobalNamespace/SettingsManager.hpp" #include "GlobalNamespace/StretchableObstacle.hpp" +#include "GlobalNamespace/ObstacleController.hpp" #include "UnityEngine/MeshFilter.hpp" #include "UnityEngine/MeshRenderer.hpp" #include "UnityEngine/Renderer.hpp" @@ -157,6 +158,10 @@ UnityEngine::Transform* CustomModels::PreviewWalls(UnityEngine::Vector3 position auto instance = GetDefaultWall()->transform; instance->SetParent(preview, false); + for (auto obstacleController : instance->GetComponentsInChildren()) { + UnityEngine::Object::DestroyImmediate(obstacleController); + } + auto stretch = instance->GetComponent(); stretch->SetAllProperties(scale.x, scale.y, scale.z, MenuWallColor(), 0);