diff --git a/include/Engine/Rendering/AnimationSystem.h b/include/Engine/Rendering/AnimationSystem.h index 0305e7c7..1d6aa5ac 100644 --- a/include/Engine/Rendering/AnimationSystem.h +++ b/include/Engine/Rendering/AnimationSystem.h @@ -16,6 +16,7 @@ #include "../Core/EEntityDeleted.h" #include "Rendering/ESetBlendWeight.h" #include "imgui/imgui.h" +#include "Input/EInputCommand.h" class AnimationSystem : public ImpureSystem { @@ -37,7 +38,13 @@ private: EventRelay m_ESetBlendWeight; bool OnSetBlendWeight(Events::SetBlendWeight& e); + EventRelay m_EInputCommand; + bool OnInputCommand(Events::InputCommand& e); + std::unordered_map m_AutoBlendQueues; + + bool Crouch = false; + float aimMove = 0; }; #endif \ No newline at end of file diff --git a/resources/Schema/Entities/AnimationDemo.xml b/resources/Schema/Entities/AnimationDemo.xml new file mode 100644 index 00000000..3a7424eb --- /dev/null +++ b/resources/Schema/Entities/AnimationDemo.xml @@ -0,0 +1,1157 @@ + + + + + + + 1 + + + + + + + + + + 1.0199999809265137 + Models/Props/Walls/SciFiWallTop.mesh + + false + + + + + + + + + + + + + + 1.5 + Models/Props/Pillars/SciFiPillar2Blue.mesh + false + + + + + + + + + + + + + + 1.5 + Models/Props/Pillars/SciFiPillar2Blue.mesh + false + + + + + + + + + + + + + 1.0699999332427979 + + + + + + + + + + + + + Models/Core/UnitSphere.mesh + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + MovementBlend + ActionBlend + + + 2.2000000476837158 + Models/Characters/Assault/FirstPersonAssaultBlue.mesh + false + + + + + + + + + + + Fire + Reload + 1 + true + + + + + + + + ReloadSwitchF + + false + + + + + + + + + ShootRifleF + false + + + + + + + + + + + Idle + Run + 1 + true + + + + + + + + RunF + + 0.80000019073486328 + true + true + + + + + + + + + IdleF + + true + true + + + + + + + + + + + R_Arm_Weapon_Joint + + + 1.5 + Models/Weapons/Blue/AssaultWeaponBlue.mesh + false + + + + + + + + + + + Schema/Entities/WeaponAssaultReloadEffectView.xml + + + + + + + + + + + + + + + + + Schema/Entities/MuzzleFlashBlue.xml + + + + + + + + + + + Schema/Entities/RayAssaultBlue.xml + + + + + + + + + + + + + + + + + + + + + + 7 + 0.60000020265579224 + + + + + + + + + + + + + BlendTreeUpper + BlendTreeLower + + + + + 2.2000000476837158 + Models/Characters/Assault/AssaultBlue.mesh + + + + + + + + + + + + + + + + L_Elbow + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + R_Elbow + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + Head + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + L_Leg_Top + + + + + 0.10000000149011612 + + + + + + + + + + + + R_Leg_Top + + + + + 0.10000000149011612 + + + + + + + + + + + + L_Leg_Bottomdw + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + R_Leg_Bottom + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + + + R_Arm_Weapon_Joint + + + Schema/Entities/WeaponAssaultBlueWorld.xml + + + + + + + AssaultWeapon + + + + + + + + + + + 1.5 + Models/Weapons/Blue/AssaultWeaponBlue.mesh + + + + + + + + Schema/Entities/ReloadEffectWorld.xml + + + + + + + + + + + + + + + + + Schema/Entities/MuzzleFlashBlue.xml + + + + + + + + + + + Schema/Entities/RayAssaultBlue.xml + + + + + + + + + + + + + + + + + R_Arm_Weapon_Joint + + + Schema/Entities/SidearmWeaponBlueWorld.xml + + + + + + + SidearmWeapon + + + + + + + + + + + MovementBlend + JumpDashBlend + 0 + true + + + + + + + + StandMovement + CrouchMovement + 0 + true + + + + + + + + DirectionBlend + Idle + 1 + + + + + + + + Walk + StrafeLRBlend + 0 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + CrouchStrafeLeftF + + true + + + + + + + + + CrouchStrafeRightF + + true + + + + + + + + + + + CrouchWalkF + + true + + + + + + + + + + + CrouchF + + true + + + + + + + + + + + DirectionBlend + Idle + 0 + + + + + + + + IdleF + + true + + + + + + + + + RunWalkBlend + StrafeLRBlend + 0 + + + + + + + + Walk + Run + 1 + + + + + + + + WalkF + + true + + + + + + + + + RunF + + 1.2000000476837158 + true + + + + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeLeftF + + true + + + + + + + + + StrafeRightF + + true + + + + + + + + + + + + + + + + + Jump + DashBlend + 1 + true + + + + + + + + JumpF + + false + + + + + + + + + DashFBBlend + DashLRBlend + 0 + + + + + + + + DashForward + DashBackward + 0 + + + + + + + + DashForwardF + + false + + + + + + + + + DashBackwardF + + false + + + + + + + + + + + DashLeft + DashRight + 0 + + + + + + + + DashLeftF + + false + + + + + + + + + DashRightF + + false + + + + + + + + + + + + + + + + + AssaultWeapon + SidearmWeapon + 0 + true + + + + + + + + Aim + WeaponBlend + + + + + + + + IdleAssault + ActionBlend + + + + + + + + Fire + Reload + 0 + + + + + + + + ReloadSwitchU + + false + + + + + + + + + ShootFastRifleU + false + + + + + + + + + + + IdleAssaultRifleU + + true + true + + + + + + + + + + + AimRifleA + + 0.10000000149011612 + false + true + + + + + + + + + + + + + + + Blending Into: + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + + Fire + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + Then into: + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + Movement + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + + + Aim: + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + + + Movement: + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + Forward + Fonts/Hind-Edited.otf,128 + + + + + + + + + + + + + + + + + + + + diff --git a/resources/Schema/Entities/PlayerAssaultAnimationDemo.xml b/resources/Schema/Entities/PlayerAssaultAnimationDemo.xml new file mode 100644 index 00000000..112bd1c6 --- /dev/null +++ b/resources/Schema/Entities/PlayerAssaultAnimationDemo.xml @@ -0,0 +1,868 @@ + + + + + + + + + + + + + + + + + + + 10 + + + + + + + + 5 + + + + + + + + + + + + BlendTreeUpper + BlendTreeLower + + + + + 2.2000000476837158 + Models/Characters/Assault/AssaultBlue.mesh + + + + + + + + + + R_Arm_Weapon_Joint + + + Schema/Entities/WeaponAssaultBlueWorld.xml + + + + + + + AssaultWeapon + + + + + + + + + + + 1.5 + Models/Weapons/Blue/AssaultWeaponBlue.mesh + + + + + + + + Schema/Entities/ReloadEffectWorld.xml + + + + + + + + + + + + + + + + + Schema/Entities/MuzzleFlashBlue.xml + + + + + + + + + + + Schema/Entities/RayAssaultBlue.xml + + + + + + + + + + + + + + + + + R_Arm_Weapon_Joint + + + Schema/Entities/SidearmWeaponBlueWorld.xml + + + + + + + SidearmWeapon + + + + + + + + + + + MovementBlend + JumpDashBlend + 2.5146881298480398e-63 + true + + + + + + + + StandMovement + CrouchMovement + 0 + true + + + + + + + + DirectionBlend + Idle + 1 + + + + + + + + Walk + StrafeLRBlend + 0 + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + CrouchStrafeLeftF + + true + + + + + + + + + CrouchStrafeRightF + + true + + + + + + + + + + + CrouchWalkF + + true + + + + + + + + + + + CrouchF + + true + + + + + + + + + + + DirectionBlend + Idle + 1 + + + + + + + + RunWalkBlend + StrafeLRBlend + 2.4565650245976452e-16 + + + + + + + + Walk + Run + 1.2938206818383024e-24 + + + + + + + + WalkF + + true + + + + + + + + + RunF + + 2 + true + + + + + + + + + + + Left + Right + 0.033793529385008014 + + + + + + + + StrafeLeftF + + 2 + true + + + + + + + + + StrafeRightF + + 2 + true + + + + + + + + + + + + + IdleF + + true + + + + + + + + + + + + + Jump + DashBlend + 1 + true + + + + + + + + JumpF + + false + + + + + + + + + DashFBBlend + DashLRBlend + 0.014621149736541383 + + + + + + + + DashForward + DashBackward + 0.014363533804961248 + + + + + + + + DashForwardF + + 1.7999999523162842 + false + + + + + + + + + DashBackwardF + + 1.7999999523162842 + false + + + + + + + + + + + DashLeft + DashRight + 4.3244885367500671e-16 + + + + + + + + DashLeftF + + 1.7999999523162842 + false + + + + + + + + + DashRightF + + 1.7999999523162842 + false + + + + + + + + + + + + + + + + + AssaultWeapon + SidearmWeapon + 0 + true + + + + + + + + Aim + WeaponBlend + + + + + + + + IdleAssault + ActionBlend + + + + + + + + Fire + Reload + 1 + + + + + + + + ReloadSwitchU + 0.5 + false + + + + + + + + + ShootFastRifleU + false + + + + + + + + + + + IdleAssaultRifleU + + true + true + + + + + + + + + + + AimRifleA + + 0.10000000149011612 + false + true + + + + + + + + + + + Aim + WeaponBlend + + + + + + + + IdleSidearm + ActionBlend + + + + + + + + Reload + Fire + 1 + + + + + + + + ReloadSwitchU + false + + + + + + + + + ShootSecWepU + false + + + + + + + + + + + IdleSecWepU + true + + + + + + + + + + + AimSecWepA + + false + true + + + + + + + + + + + + + + + + + + L_Elbow + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + R_Elbow + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + Head + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + L_Leg_Top + + + + + 0.10000000149011612 + + + + + + + + + + + + R_Leg_Top + + + + + 0.10000000149011612 + + + + + + + + + + + + L_Leg_Bottomdw + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + R_Leg_Bottom + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + 0.10000000149011612 + + + + + + + + + + + + + + + + diff --git a/src/Engine/Rendering/AnimationSystem.cpp b/src/Engine/Rendering/AnimationSystem.cpp index 895cbc28..057038d5 100644 --- a/src/Engine/Rendering/AnimationSystem.cpp +++ b/src/Engine/Rendering/AnimationSystem.cpp @@ -6,6 +6,7 @@ AnimationSystem::AnimationSystem(SystemParams params) EVENT_SUBSCRIBE_MEMBER(m_EAutoAnimationBlend, &AnimationSystem::OnAutoAnimationBlend); EVENT_SUBSCRIBE_MEMBER(m_EEntityDeleted, &AnimationSystem::OnEntityDeleted); EVENT_SUBSCRIBE_MEMBER(m_ESetBlendWeight, &AnimationSystem::OnSetBlendWeight); + EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &AnimationSystem::OnInputCommand); } void AnimationSystem::Update(double dt) @@ -14,6 +15,19 @@ void AnimationSystem::Update(double dt) CreateBlendTrees(); UpdateWeights(dt); + EntityWrapper aimEntity = m_World->GetFirstEntityByName("ThirdPerson").FirstChildByName("Aim"); + (Field)aimEntity["Animation"]["Time"] = glm::clamp((const double&)(Field)aimEntity["Animation"]["Time"] + ((aimMove * 0.2f) * dt), 0.0, 1.0); + + + EntityWrapper aimTextEntity = m_World->GetFirstEntityByName("AimText"); + + if (aimMove > 0) { + (Field)aimTextEntity["Text"]["Content"] = "Up"; + } else if (aimMove < 0) { + (Field)aimTextEntity["Text"]["Content"] = "Down"; + } else { + (Field)aimTextEntity["Text"]["Content"] = " "; + } for(auto& autoBlendQueue : m_AutoBlendQueues) { autoBlendQueue.second.UpdateTime(dt); @@ -353,3 +367,357 @@ bool AnimationSystem::OnSetBlendWeight(Events::SetBlendWeight& e) } } + +bool AnimationSystem::OnInputCommand(Events::InputCommand& e) +{ + EntityWrapper firstPerson = m_World->GetFirstEntityByName("FirstPerson"); + EntityWrapper thirdPerson = m_World->GetFirstEntityByName("ThirdPerson"); + + EntityWrapper currentBlend = m_World->GetFirstEntityByName("CurrentBlend"); + EntityWrapper queuedBlend = m_World->GetFirstEntityByName("QueuedBlend"); + EntityWrapper MovementText = m_World->GetFirstEntityByName("MovementText"); + + + if (e.Command == "ClearText") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = " "; + (Field)queuedBlend["Text"]["Content"] = " "; + } + } + + if(e.Command == "Jump") { + if(e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Jump"; + (Field)queuedBlend["Text"]["Content"] = "Movement"; + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.2f; + blendEvent.NodeName = "Jump"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventQueued; + blendEventQueued.RootNode = thirdPerson; + blendEventQueued.Delay = -0.1; + blendEventQueued.Duration = 0.3f; + blendEventQueued.NodeName = "MovementBlend"; + blendEventQueued.AnimationEntity = thirdPerson.FirstChildByName("Jump"); + m_EventBroker->Publish(blendEventQueued); + } + } + + if (e.Command == "DashL") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Dash Left"; + (Field)queuedBlend["Text"]["Content"] = "Movement"; + + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.2f; + blendEvent.NodeName = "DashLeft"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventQueued; + blendEventQueued.RootNode = thirdPerson; + blendEventQueued.Delay = -0.1; + blendEventQueued.Duration = 0.3f; + blendEventQueued.NodeName = "MovementBlend"; + blendEventQueued.AnimationEntity = thirdPerson.FirstChildByName("DashLeft"); + m_EventBroker->Publish(blendEventQueued); + } + } + + if (e.Command == "DashR") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Dash Right"; + (Field)queuedBlend["Text"]["Content"] = "Movement"; + + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.2f; + blendEvent.NodeName = "DashRight"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventQueued; + blendEventQueued.RootNode = thirdPerson; + blendEventQueued.Delay = -0.1; + blendEventQueued.Duration = 0.3f; + blendEventQueued.NodeName = "MovementBlend"; + blendEventQueued.AnimationEntity = thirdPerson.FirstChildByName("DashRight"); + m_EventBroker->Publish(blendEventQueued); + } + } + + if (e.Command == "DashF") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Dash Forward"; + (Field)queuedBlend["Text"]["Content"] = "Movement"; + + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.2f; + blendEvent.NodeName = "DashForward"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventQueued; + blendEventQueued.RootNode = thirdPerson; + blendEventQueued.Delay = -0.1; + blendEventQueued.Duration = 0.3f; + blendEventQueued.NodeName = "MovementBlend"; + blendEventQueued.AnimationEntity = thirdPerson.FirstChildByName("DashForward"); + m_EventBroker->Publish(blendEventQueued); + } + } + + if (e.Command == "DashB") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Dash Backward"; + (Field)queuedBlend["Text"]["Content"] = "Movement"; + + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.2f; + blendEvent.NodeName = "DashBackward"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventQueued; + blendEventQueued.RootNode = thirdPerson; + blendEventQueued.Delay = -0.1; + blendEventQueued.Duration = 0.3f; + blendEventQueued.NodeName = "MovementBlend"; + blendEventQueued.AnimationEntity = thirdPerson.FirstChildByName("DashBackward"); + m_EventBroker->Publish(blendEventQueued); + } + } + + + if (e.Command == "Right") { + if (e.Value > 0) { + (Field)MovementText["Text"]["Content"] = "Right"; + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.3f; + blendEvent.NodeName = "Right"; + blendEvent.Start = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Run"; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + + + } else if (e.Value < 0) { + (Field)MovementText["Text"]["Content"] = "Left"; + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.3f; + blendEvent.NodeName = "Left"; + blendEvent.Start = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Run"; + blendEventFP.Reverse = true; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + } + }else if (e.Command == "Up") { + if (e.Value > 0) { + (Field)MovementText["Text"]["Content"] = "Forward"; + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.3f; + if (Crouch) { + blendEvent.NodeName = "Walk"; + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Idle"; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + + } else { + blendEvent.NodeName = "Run"; + + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Run"; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + + } + blendEvent.Start = true; + m_EventBroker->Publish(blendEvent); + }else if (e.Value < 0) { + (Field)MovementText["Text"]["Content"] = "Backward"; + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.3f; + if(Crouch) { + blendEvent.NodeName = "Walk"; + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Idle"; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + } else { + blendEvent.NodeName = "Run"; + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Run"; + blendEventFP.Reverse = true; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + } + blendEvent.Start = true; + blendEvent.Reverse = true; + m_EventBroker->Publish(blendEvent); + } + } + + if (e.Command == "Idle"){ + if (e.Value > 0) { + (Field)MovementText["Text"]["Content"] = "Idle"; + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.5f; + blendEvent.NodeName = "Idle"; + blendEvent.Start = true; + blendEvent.Reverse = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.3f; + blendEventFP.NodeName = "Idle"; + blendEventFP.Start = true; + m_EventBroker->Publish(blendEventFP); + } + } + + + if (e.Command == "Crouch") { + if (e.Value > 0) { + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.5f; + blendEvent.NodeName = "CrouchMovement"; + blendEvent.Start = true; + blendEvent.Reverse = true; + m_EventBroker->Publish(blendEvent); + Crouch = true; + } else { + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.5f; + blendEvent.NodeName = "StandMovement"; + blendEvent.Start = true; + blendEvent.Reverse = true; + m_EventBroker->Publish(blendEvent); + Crouch = false; + } + } + + if (e.Command == "Aim") { + aimMove = e.Value; + } + + if (e.Command == "Shoot") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Fire"; + (Field)queuedBlend["Text"]["Content"] = "Idle"; + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.1f; + blendEvent.NodeName = "Fire"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.1f; + blendEventFP.NodeName = "Fire"; + blendEventFP.Start = true; + blendEventFP.Restart = true; + m_EventBroker->Publish(blendEventFP); + } + } + + + if (e.Command == "Reload") { + if (e.Value > 0) { + (Field)currentBlend["Text"]["Content"] = "Reload"; + (Field)queuedBlend["Text"]["Content"] = "Idle"; + + + Events::AutoAnimationBlend blendEvent; + blendEvent.RootNode = thirdPerson; + blendEvent.Duration = 0.1f; + blendEvent.NodeName = "Reload"; + blendEvent.Start = true; + blendEvent.Restart = true; + m_EventBroker->Publish(blendEvent); + + Events::AutoAnimationBlend blendEventQ; + blendEventQ.RootNode = thirdPerson; + blendEventQ.Duration = 0.2f; + blendEventQ.Delay = -0.1; + blendEventQ.NodeName = "Fire"; + blendEventQ.Start = false; + blendEventQ.Restart = true; + blendEventQ.AnimationEntity = thirdPerson.FirstChildByName("Reload"); + m_EventBroker->Publish(blendEventQ); + + + + Events::AutoAnimationBlend blendEventFP; + blendEventFP.RootNode = firstPerson; + blendEventFP.Duration = 0.1f; + blendEventFP.NodeName = "Reload"; + blendEventFP.Start = true; + blendEventFP.Restart = true; + m_EventBroker->Publish(blendEventFP); + + Events::AutoAnimationBlend blendEventFPQ; + blendEventFPQ.RootNode = firstPerson; + blendEventFPQ.Duration = 0.2f; + blendEventFPQ.Delay = -0.1; + blendEventFPQ.NodeName = "Fire"; + blendEventFPQ.Start = false; + blendEventFPQ.Restart = true; + blendEventFPQ.AnimationEntity = thirdPerson.FirstChildByName("Reload"); + m_EventBroker->Publish(blendEventFPQ); + + } + } + + return true; +}