From 7783c4a165ce36d8d7395be0ccf0517e6105c77e Mon Sep 17 00:00:00 2001 From: Franklin Blanco Date: Sun, 17 Sep 2023 18:01:37 -0700 Subject: [PATCH] RELOAD SYSTEM WITH ANIMATION DONE! --- assets/weapons/m4a1_rifle.glb | Bin 55110836 -> 55112272 bytes src/logic/core/guns/player_firing.rs | 2 + src/logic/core/guns/spawn_firearm.rs | 3 +- src/logic/core/player/camera_effects.rs | 12 --- src/logic/core/player/hands.rs | 137 ++++++++++++++---------- src/scenes/scene1/init.rs | 4 +- src/setup/animations.rs | 2 +- 7 files changed, 89 insertions(+), 71 deletions(-) diff --git a/assets/weapons/m4a1_rifle.glb b/assets/weapons/m4a1_rifle.glb index 366b2adf0485d2ea8da2acf6bf4cce5536bb6dd0..af01c313fda779244656d8ad594af8f5c36e04a2 100644 GIT binary patch delta 6577 zcmZ|P1yoddzMp-#^SgIoRCZs7z+;^uWuGw!Z)Ms-4pB zzpj}o6~;R}${8M^+2CmVbM3n1IL^aPschtxFfhfdc^}^7=Nvxvu#CJKU6OjW_SQq8wps<{KEG zaR{rdi4Lt{=IOd(LCUiG%#^;qn(4vr znrop>rb=H;p{TAIA6~^=>5Fe8BfPVfQW4-Ywcpg5J-5zy8b14JcsXQ>%#b;mYD^v+tBO7Fk?2tWjK#r&~aza&5RpgASAs6I|+>kq}j%pweR1 ztx*JuL~T%8)DE>r9Z*Nq2}PmKs0-?fx}ol<2Z}~LQ7_aR^+A16Khz%$Krv__8iWR; zA!sOyMZ-`W8jePwktiM|phT2}lF=wM8jV3?(Ks|7O+YDVBASFIqbX=AnugRU6-`HJ zXa-70Gtn$G8_hv;(L6LCEkM7ag(w4MqD5#i(x4@1DO!e>qZMc+`W>x8tI-;?7GyOuIVcz9p$%vw%14{fX0!!uMcdGJv;!5OLbMa@Lc7r)s0i&rd(l3$A00r&NJd(u zLwa-&9YTlE5p)zCL&wnxbP}CHr_mYoC;AJWMd#3Y^f$VIE}{~23H^gEqbuktx`wW! z8|Wswg>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}8~Q+B z=m-7b6BqykVGs<4PhkiQg-pnTVK5v(?1Z~{)kDL4&h;4GYj-{3r4fQxVmF2fbL3fJH|+<=>K3vR<5xC{5-K0JVj@Cbf~ z$M6K6!ZUadf4~cP39sNayn(mb_4xD9kR3e01fGxsazZZ14SB!|@`5+`fG_xgKLmgo z0wDQ+d zU+4$@;S(4D17Q#hhEHJ#424X{f?+TmM!-n;3`W6d7z1Nr9E^tvFcBufWS9a|VHy}P z9cI8xm<6+84$Osl@Hxzf1>k@$U?F@7i(oM0pI|@y48Onu_!SPqAvg?2 z;3yn}<8T5_!YMcnXW%THgWuphT!4#k2`hk;66Nnhwun~ zhsW>)p29PD4u8N4cnPoIHN1hh9(w$lG-L-4Fo7rJfSiyEazh^Qg1q1jKHv*};12;{ zhCm2{e2^asKtTwG5GVwp5C(-I9Ew0uh=52a22oHPN$YSPzfqS6|h59s0P&`8B)M~u&GQnO-?=jOnn!6Y_U5Y-b^zUcP!99 zID#DU_tQ*fM^)+RXmdTyG$AwR%jeGYF~jUxWgL|r*UjcCx~sE$K0M0HmHI5oJ$Gvq z?8=xwx(aK2&zE)`NUpw}*{exq*Da4SPUck?>bX+aO?JPl*O|DSW_Ki~Y{bF(>}Ts7WYagNZ9+eNi;oq4j?IZku?wT)c)mO7l%HTzFV zag~1F(z#HxcZkh($~d!qjpp2oBVE~67uvc_^M(=OL9PWo_f*-ZH=BHOyUsU@w;$0w zD(`s_?Ua{v3Z{TVdMSoIWv8^{czMy_nh%!wLNLG^S^%H{U7U} UXrF29, - mut players: Query<&mut AnimationPlayer, Added>, -) { - for mut player in &mut players { - player.play(animations.reload_magazine.clone_weak()).repeat(); - } -} \ No newline at end of file diff --git a/src/logic/core/player/hands.rs b/src/logic/core/player/hands.rs index dc9eaaf..a24a3c7 100644 --- a/src/logic/core/player/hands.rs +++ b/src/logic/core/player/hands.rs @@ -2,11 +2,12 @@ use bevy::prelude::*; use crate::{ comps::core::markers::{firearm::{FirearmData, MagazineData}, holdable::InPlayerHands, player::PlayerHand}, - logic::core::guns::player_firing::PlayerFiringInfo, utils::rad_deg::radians_from_degrees, + logic::core::guns::player_firing::PlayerFiringInfo, utils::rad_deg::radians_from_degrees, setup::animations::FirearmAnimations, }; pub fn capture_hand_usage( mouse_buttons: Res>, + keyboard_input: Res>, mut hand_query: Query<&mut Transform, With>, time: Res