Guest User

Untitled

a guest
Apr 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #include "ABCharacter.h"
  4. #include "ABAnimInstance.h"
  5. #include "ABWeapon.h"
  6. #include "DrawDebugHelpers.h"
  7.  
  8. /*...*/
  9.  
  10. bool AABCharacter::CanSetWeapon()
  11. {
  12. return (nullptr == CurrentWeapon);
  13. }
  14.  
  15. void AABCharacter::SetWeapon(AABWeapon * NewWeapon)
  16. {
  17. ABCHECK(nullptr != NewWeapon && nullptr == CurrentWeapon);
  18. FName WeaponSocket(TEXT("hand_rSocket"));
  19. if (nullptr != NewWeapon)
  20. {
  21. NewWeapon->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, WeaponSocket);
  22. NewWeapon->SetOwner(this);
  23. CurrentWeapon = NewWeapon;
  24. }
  25. }
  26.  
  27. /*...*/
Add Comment
Please, Sign In to add comment