Skip to content

Commit

Permalink
Added manual reinit for trail script
Browse files Browse the repository at this point in the history
  • Loading branch information
vbif1 committed Oct 29, 2021
1 parent 406b9e4 commit 6ce21f0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hyper_trails/trail_maker.script
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ 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)
trail_maker.init_data_points(self)
trail_maker.draw_trail(self)
end

function init(self)
reset_trail(self)
end

function final(self)
end

Expand All @@ -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

0 comments on commit 6ce21f0

Please sign in to comment.