add code
This commit is contained in:
31
Source/CodRemake/Weapon/BaseWeapon.cpp
Normal file
31
Source/CodRemake/Weapon/BaseWeapon.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "BaseWeapon.h"
|
||||
|
||||
|
||||
// Sets default values
|
||||
ABaseWeapon::ABaseWeapon()
|
||||
{
|
||||
PrimaryActorTick.bCanEverTick = false;
|
||||
|
||||
Root = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
|
||||
RootComponent = Root;
|
||||
|
||||
WeaponMeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Weapon"));
|
||||
WeaponMeshComponent->SetupAttachment(Root);
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void ABaseWeapon::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
// void ABaseWeapon::Tick(float DeltaTime)
|
||||
// {
|
||||
// Super::Tick(DeltaTime);
|
||||
// }
|
||||
|
||||
35
Source/CodRemake/Weapon/BaseWeapon.h
Normal file
35
Source/CodRemake/Weapon/BaseWeapon.h
Normal file
@@ -0,0 +1,35 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "BaseWeapon.generated.h"
|
||||
|
||||
UCLASS(Abstract)
|
||||
class CODREMAKE_API ABaseWeapon : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this actor's properties
|
||||
ABaseWeapon();
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
||||
float Damage;
|
||||
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
public:
|
||||
// Called every frame
|
||||
// virtual void Tick(float DeltaTime) override;
|
||||
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<USceneComponent> Root;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<USkeletalMeshComponent> WeaponMeshComponent;
|
||||
};
|
||||
Reference in New Issue
Block a user