From 5432879e81af8c605b839832f1bb29f3ef7c8935 Mon Sep 17 00:00:00 2001 From: Ronja Date: Wed, 26 Jan 2022 21:23:16 +0100 Subject: [PATCH] make trail editor-safe ..I think --- api/modifier/trail.wren | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/api/modifier/trail.wren b/api/modifier/trail.wren index dc2b8f3..078f8b4 100644 --- a/api/modifier/trail.wren +++ b/api/modifier/trail.wren @@ -438,6 +438,18 @@ class TrailSystem is ModifierSystem { } tick(delta) { + if(World.tag_has(_world, "edit")){ + each{|entity, data: ModifierData| + if(!Transform.has(entity)) return + + start = Transform.local_point_to_world(entity, 0, data.edge_length * -0.5, 0) + end = Transform.local_point_to_world(entity, 0, data.edge_length * 0.5, 0) + Draw.path3D(_draw, [start, end], _debug_edge_style, false) + } + Draw.commit(_draw) + return + } + //System.print("positions") record_positions(delta) //System.print("buffers")