Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #include "ABCharacter.h"
- #include "ABAnimInstance.h"
- #include "ABWeapon.h"
- #include "DrawDebugHelpers.h"
- /*...*/
- bool AABCharacter::CanSetWeapon()
- {
- return (nullptr == CurrentWeapon);
- }
- void AABCharacter::SetWeapon(AABWeapon * NewWeapon)
- {
- ABCHECK(nullptr != NewWeapon && nullptr == CurrentWeapon);
- FName WeaponSocket(TEXT("hand_rSocket"));
- if (nullptr != NewWeapon)
- {
- NewWeapon->AttachToComponent(GetMesh(), FAttachmentTransformRules::SnapToTargetNotIncludingScale, WeaponSocket);
- NewWeapon->SetOwner(this);
- CurrentWeapon = NewWeapon;
- }
- }
- /*...*/
Add Comment
Please, Sign In to add comment