From 6ce21f07f05dd1c4ec79b33798bd035b11187326 Mon Sep 17 00:00:00 2001 From: Mikhail Gudkov Date: Fri, 29 Oct 2021 17:26:58 +0300 Subject: [PATCH] Added manual reinit for trail script --- hyper_trails/trail_maker.script | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hyper_trails/trail_maker.script b/hyper_trails/trail_maker.script index b129ffa..cf95c09 100755 --- a/hyper_trails/trail_maker.script +++ b/hyper_trails/trail_maker.script @@ -15,7 +15,7 @@ go.property("texture_tiling", true) go.property("trail_model_url", msg.url("#trail_model")) go.property("auto_update", true) -function init(self) +local function reset_trail(self) trail_maker.init_vars(self) trail_maker.init_props(self) trail_maker.create_texture(self) @@ -23,6 +23,10 @@ function init(self) trail_maker.draw_trail(self) end +function init(self) + reset_trail(self) +end + function final(self) end @@ -39,9 +43,12 @@ function update(self, dt) end local UPDATE = hash("update") +local RESET = hash("reset") function on_message(self, message_id, message, sender) if message_id == UPDATE then update_trail(self, message.dt or self.dt) + elseif message_id == RESET then + reset_trail(self) end end