From be91fc50054ccb9608b65b92d83f75df98bbd930 Mon Sep 17 00:00:00 2001 From: William Moberg Date: Sun, 13 Mar 2016 23:23:36 +0100 Subject: [PATCH] WIP dash effect fade weapon 2. --- src/Game/Systems/PlayerMovementSystem.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Game/Systems/PlayerMovementSystem.cpp b/src/Game/Systems/PlayerMovementSystem.cpp index 74a8de7e..71954a8f 100644 --- a/src/Game/Systems/PlayerMovementSystem.cpp +++ b/src/Game/Systems/PlayerMovementSystem.cpp @@ -90,11 +90,12 @@ void PlayerMovementSystem::Update(double dt) cAnim["Animation"]["Play"] = false; } for (auto& cModel : dashEffect.ChildrenWithComponent("Model")) { - Entity.AttachComponent("Lifetime"); - dashEffect.AttachComponent("Fade"); - dashEffect["Fade"]["Loop"] = false; - dashEffect["Fade"]["FadeTime"] = 0.5; - dashEffect["Fade"]["Time"] = (double)dashEffect["Fade"]["FadeTime"]; + EntityWrapper e(m_World, cModel.ID); + e.AttachComponent("Lifetime"); + e.AttachComponent("Fade"); + e["Fade"]["Loop"] = false; + e["Fade"]["FadeTime"] = 0.5; + e["Fade"]["Time"] = (double)dashEffect["Fade"]["FadeTime"]; } dashEffect.AttachComponent("Lifetime"); dashEffect.AttachComponent("Fade");