rickfromwork пре 4 година
родитељ
комит
cbce658c54
1 измењених фајлова са 6 додато и 1 уклоњено
  1. 6 1
      gui/src/3D/controls/touchButton3D.ts

+ 6 - 1
gui/src/3D/controls/touchButton3D.ts

@@ -120,7 +120,12 @@ export class TouchButton3D extends Button3D {
                 }
 
                 // Debug line mesh
-                debugLineMesh.dispose();
+                if (debugLineMesh)
+                {
+                    // remove the previous line before drawing the new one
+                    debugLineMesh.dispose();
+                }
+                
                 debugLineMesh = Mesh.CreateLines("debug_line", [
                     _this._collisionMesh.getAbsolutePosition(),
                     indexMesh.getAbsolutePosition()